Nuclos JaCoCo: code coverage, offline weaving, jacoco-maven-plugin, jacoco.exec, coverage profile, mvn verify, AspectJ.

globe with meridians Language: Deutsch ยท English

hammer and wrench Code coverage (JaCoCo)

Code coverage with JaCoCo โ€“ offline weaving, coverage profile and report generation.

On this page

Code coverage of the Nuclos build and the integration tests is measured with JaCoCo (from v4.2024.13).

Process

  1. Offline weaving via the jacoco-maven-plugin after javac but before the AspectJ bytecode manipulation (runtime online weaving did not work for Nuclos due to AspectJ/Spring weaving).
  2. Include the JaCoCo runtime as a dependency in all Maven modules.
  3. Unit and integration tests write all coverage data to $NUCLOS_GIT_ROOT/target/jacoco.exec.

Invocation

Activation via the Maven profile coverage, e.g. for the Tomcat server integration tests:

mvn clean verify -Dlocale=de_DE -Dtest.webclient.skip=true -P coverage,test,test-tomcat

Create a report per module:

mvn jacoco:report@coverage-report

The Sonar code analysis automatically uses the JaCoCo reports if present.

Related pages

gear Sonar code analysis


Sonar.

Open โ†’

gear Unit tests with TestNG or JUnit and Spring support


Unit tests.

Open โ†’