In My project, if I write pom like this:
...
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>post-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
...
it will not generate report in my project after i run mvn install.
but i change it to
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>pre-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>post-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
it worked!!
I want to know what was the different?
I read the offical document here: http://www.jacoco.org/jacoco/trunk/doc/prepare-agent-mojo.html
the goal prepare-agent is just for set property for jvm agent, not start jvm agent, why it is necessary?