Build

The JaCoCo build is based on Maven and can be locally executed on every machine with a proper environment setup. In particular you need JDK 17 installation. Developers are encouraged to run the build before every commit to ensure consistency of the source tree.

Running the Build

The build can be started by executing the Maven Wrapper using following command with ./org.jacoco.build/ as the working directory:

  ../mvnw clean verify

Total build time is typically around 3 minutes, however first build might take more time, because Maven should download plugins and dependencies. The download ZIP will be created at the following location:

  ../jacoco/target/jacoco-x.y.z.qualifier.zip

Running Quick Build without Tests

It is not recommended, however possible to the run build without any tests:

  ../mvnw clean verify -DskipTests

Compilation and testing with different JDKs

By default for compilation and execution of tests will be used JDK that runs Maven. Alternatively you can use JDK from Maven Toolchains by setting property jdk.version.

Following table shows in which classfile version modules will be compiled to depending on version of JDK (empty cells = no compilation possible):

Modules JDK 5 JDK 6 JDK 7 JDK 8 JDK 9 JDK 10 JDK 11 JDK 12 JDK 13 JDK 14 JDK 15 JDK 16 JDK 17 JDK 18 JDK 19 JDK 20 JDK 21 JDK 22 JDK 23
org.jacoco.core.test.validation.java21 21 21 21
org.jacoco.core.test.validation.java16 16 16 16 16 16 16 16 16
org.jacoco.core.test.validation.java14 14 14 14 14 14 14 14 14 14 14
org.jacoco.core.test.validation.java8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
org.jacoco.core.test.validation.java7 7 7 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8
org.jacoco.core.test.validation.groovy 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
org.jacoco.core.test.validation.kotlin 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
org.jacoco.core.test.validation.scala 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
all other modules 5 5 5 5 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8

Alternatively you can specify bytecode version for all modules using property bytecode.version.

For example to use JDK 10 from Maven Toolchains and compile all modules into bytecode version 53 (Java 9):

  ../mvnw clean verify -Djdk.version=10 -Dbytecode.version=9

Also Eclipse Compiler for Java can be used for compilation:

  ../mvnw clean verify -Decj

Combining these options JaCoCo is regularly tested with the following setups: