Maven Plug-in

The JaCoCo Maven plug-in provides the JaCoCo runtime agent to your tests and allows basic report creation.

If you want to have line number information included in the coverage reports or you want source code highlighting the class files of the test target must be compiled with debug information.

When using the maven-surefire-plugin or maven-failsafe-plugin you must not use a forkCount of 0 or set the forkMode to never as this would prevent the execution of the tests with the javaagent set and no coverage would be recorded.



The JaCoCo Maven plug-in requires


The Maven plug-in can be included in your build with the following declaration. Please check here for the latest release version in the repository.


To receive a full list of goals and available parameters you can use maven-help-plugin:

mvn help:describe -Dplugin=org.jacoco:jacoco-maven-plugin -Ddetail


The JaCoCo Maven plug-in defines the following goals: