Java project config (JaCoCo)

JaCoCo reports are an essential component of Cover Reports. Some projects have access to a version of JaCoCo that Cover can use, either through their original configuration or via Cover itself (using Maven). However, if Cover cannot find a suitable JaCoCo configuration (typically detected during Preflight checks), the following minor configuration update for your projects to add the appropriate dependencies and plugins (if you're not already using JaCoCo) should be sufficient.

Add the following declarations to the pom.xml file for the project. The dependency ensures that JaCoCo is available for Cover to use for coverage and reporting analysis. The plugin below configures the JaCoCo plugin to provide reporting information when running tests on the project.

<dependency>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.8.7</version>
</dependency>
<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.8.7</version>
  <executions>
    <execution>
      <goals>
        <goal>prepare-agent</goal>
      </goals>
    </execution>
    <execution>
      <id>report</id>
      <phase>test</phase>
      <goals>
        <goal>report</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Last updated

Was this helpful?