To execute JaCoCo as part of your Maven build in order to generate the binary format of JaCoCo, use this command:
If your project uses the
argLine property to configure the surefire-maven-plugin, be sure that
argLine defined as a
property, rather than as part of the plugin configuration. Doing so will allow JaCoCo to set its agent properly. Otherwise the JVM may crash while tests are running.
argLine should be defined this way:
Know Old Issue
There is a known issue on version 0.7.3 of JaCoCo agent producing binary reports incompatible with JaCoCo analyzer 0.7.2 embedded in SonarJava.
This issue is fixed with version 0.7.4+ of the agent, so please prefer this version.
SonarJava is compatible with JaCoCo 0.7.5 starting from SonarJava 3.4.