maven jacoco: not generating code coverage report

Any particular reason why you are using an outdated version of the JaCoCo plugin? For Java 8 support, you have to use at least version 0.7.0 (see changelog).

In your configuration, the report goal is bound to the verify phase, so running mvn test won’t generate any report because it does not run the verify phase (test phase comes before verify). You have to use mvn verify to execute tests and generate the report.

The JaCoCo project provides example Maven configurations. You can try “this POM file for a JAR project runs JUnit tests under code coverage and creates a coverage report“.

Leave a Comment