MikeHT (137) [Avatar] Offline
#1
When I try to run goal

mvn jacoco:report

in the spring-standalone-swing project I get the following error

[INFO] Skipping JaCoCo execution due to missing execution data file:/Users/mht/JavaTestingWithSpock/code/java-testing-with-spock-master/chapter7/spring-standalone-swing/target/jacoco.exec

Does anyone know the solution?

Note if you create the file target/jacoco.exec, the task will run, but no output is generated. If you create the file target/jacoco.exec and run gradle jacocoTestReport, you will get files target/site/jacoco.csv and target/site/jacoco.xml
Kostis Kapelonis (63) [Avatar] Offline
#2
Hello

Apparently the full command is not in the book. The Jacoco report assumes that the tests have run at least once.


Try running
mvn test jacoco:report


This should work!

Kostis