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 at least Maven 3.3.9 and JDK 8 installations. 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 following command with ./org.jacoco.build/ as the working directory:

  mvn clean install

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:

  mvn clean install -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 how modules will be compiled depending on version of JDK:

JDK 5 JDK 6 JDK 7 JDK 8 JDK 9 JDK 10
org.jacoco.core.test.validation.java7 excluded from build compiled into bytecode version 51 (Java 7)
org.jacoco.core.test.validation.java8 excluded from build compiled into bytecode version 52 (Java 8)
all other modules compiled into bytecode version 49 (Java 5) compiled into bytecode version 50 (Java 6)

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):

  mvn clean install -Djdk.version=10 -Dbytecode.version=9

Also Eclipse Compiler for Java can be used for compilation:

  mvn clean install -Decj

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