maven - Getting "Skipping JaCoCo execution due to missing execution data file" upon executing JaCoCo? -
i'm using maven 3.0.3, junit 4.8.1, , jacoco 0.6.3.201306030806, , trying create test coverage reports.
i have project unit tests can't reports run, repeatedly getting error skipping jacoco execution due missing execution data file
when run:
mvn clean install -p test-coverage
here how pom configured:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <version>2.14.1</version> <configuration> <reuseforks>true</reuseforks> <argline>-xmx2048m</argline> </configuration> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-failsafe-plugin</artifactid> <version>2.14.1</version> <configuration> <reuseforks>true</reuseforks> <argline>-xmx4096m -xx:maxpermsize=512m ${itcoverageagent}</argline> </configuration> <executions> <execution> <goals> <goal>integration-test</goal> <goal>verify</goal> </goals> </execution> </executions> </plugin> ... <profile> <id>test-coverage</id> <build> <plugins> <plugin> <groupid>org.jacoco</groupid> <artifactid>jacoco-maven-plugin</artifactid> <version>0.6.3.201306030806</version> <configuration> <destfile>${basedir}/target/coverage-reports/jacoco-unit.exec</destfile> <datafile>${basedir}/target/coverage-reports/jacoco-unit.exec</datafile> </configuration> <executions> <execution> <id>prepare-unit-tests</id> <goals> <goal>prepare-agent</goal> </goals> </execution> <!-- prepare agent measuring integration tests --> <execution> <id>prepare-integration-tests</id> <goals> <goal>prepare-agent</goal> </goals> <phase>pre-integration-test</phase> <configuration> <propertyname>itcoverageagent</propertyname> </configuration> </execution> <execution> <id>jacoco-site</id> <phase>verify</phase> <goals> <goal>report</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile>
all tests run successfully. here of output maven …
[info] --- jacoco-maven-plugin:0.6.2.201302030002:prepare-agent (prepare-unit-tests) @ myproject --- [info] argline set -javaagent:/users/davea/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar=destfile=/users/davea/dropbox/workspace/myproject/target/jacoco.exec [info] ... tests run: 14, failures: 0, errors: 0, skipped: 0 [info] ... [info] [info] --- jacoco-maven-plugin:0.6.2.201302030002:prepare-agent (prepare-integration-tests) @ myproject --- [info] itcoverageagent set -javaagent:/users/davea/.m2/repository/org/jacoco/org.jacoco.agent/0.6.2.201302030002/org.jacoco.agent-0.6.2.201302030002-runtime.jar=destfile=/users/davea/dropbox/workspace/myproject/target/jacoco.exec [info] [info] --- maven-failsafe-plugin:2.14.1:integration-test (default) @ myproject --- [warning] file encoding has not been set, using platform encoding macroman, i.e. build platform dependent! [info] [info] --- maven-failsafe-plugin:2.14.1:verify (default) @ myproject --- [info] failsafe report directory: /users/davea/dropbox/workspace/myproject/target/failsafe-reports [warning] file encoding has not been set, using platform encoding macroman, i.e. build platform dependent! [info] [info] --- jacoco-maven-plugin:0.6.2.201302030002:report (jacoco-site) @ myproject --- [info] skipping jacoco execution due missing execution data file [info]
any ideas configuration i'm missing?
jacoco-maven-plugin:0.7.10-snapshot
from jacoco:prepare-agent says:
one of ways in case of maven-surefire-plugin - use syntax late property evaluation:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <configuration> <argline>@{argline} -your -extra -arguments</argline> </configuration> </plugin>
note @{argline}
that's added -your -extra -arguments
.
thanks slava semushin noticing change , reporting in comment.
jacoco-maven-plugin:0.7.2-snapshot
following jacoco:prepare-agent says:
[org.jacoco:jacoco-maven-plugin:0.7.2-snapshot:prepare-agent] prepares property pointing jacoco runtime agent can passed vm argument application under test. depending on project packaging type default property following name set:
- tycho.testargline packaging type eclipse-test-plugin and
- argline otherwise.
note these properties must not overwritten test configuration, otherwise jacoco agent cannot attached. if need custom parameters please append them. example:
<argline>${argline} -your -extra -arguments</argline>
resulting coverage information collected during execution , default written file when process terminates.
you should change following line in maven-surefire-plugin
plugin configuration (note ${argline}
inside <argline>
):
<argline>-xmx2048m</argline>
to
<argline>${argline} -xmx2048m</argline>
make necessary changes other plugin maven-failsafe-plugin
, replace following (again, notice ${argline}
):
<argline>-xmx4096m -xx:maxpermsize=512m ${itcoverageagent}</argline>
to
<argline>${argline} -xmx4096m -xx:maxpermsize=512m ${itcoverageagent}</argline>
Comments
Post a Comment