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:
../mvnw clean verify -Djdk.version=5 -Dbytecode.version=5
../mvnw clean verify -Djdk.version=6 -Dbytecode.version=6
../mvnw clean verify -Djdk.version=7 -Dbytecode.version=7
../mvnw clean verify -Djdk.version=8 -Dbytecode.version=8
../mvnw clean verify -Djdk.version=9 -Dbytecode.version=9
../mvnw clean verify -Djdk.version=10 -Dbytecode.version=10
../mvnw clean verify -Djdk.version=11 -Dbytecode.version=11
../mvnw clean verify -Djdk.version=11 -Dbytecode.version=11 -Decj
../mvnw clean verify -Djdk.version=12 -Dbytecode.version=12
../mvnw clean verify -Djdk.version=13 -Dbytecode.version=13
../mvnw clean verify -Djdk.version=14 -Dbytecode.version=14
../mvnw clean verify -Djdk.version=15 -Dbytecode.version=15
../mvnw clean verify -Djdk.version=16 -Dbytecode.version=16
../mvnw clean verify -Djdk.version=17 -Dbytecode.version=17
../mvnw clean verify -Djdk.version=17 -Dbytecode.version=17 -Decj
../mvnw clean verify -Djdk.version=18 -Dbytecode.version=18
../mvnw clean verify -Djdk.version=19 -Dbytecode.version=19
../mvnw clean verify -Djdk.version=20 -Dbytecode.version=20
../mvnw clean verify -Djdk.version=21 -Dbytecode.version=21
../mvnw clean verify -Djdk.version=21 -Dbytecode.version=21 -Decj
../mvnw clean verify -Djdk.version=22 -Dbytecode.version=22
../mvnw clean verify -Djdk.version=23 -Dbytecode.version=23