Skip to content

Instantly share code, notes, and snippets.

@caliburn1994
Last active November 25, 2020 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caliburn1994/253966dec3ece0c020ebb8ab863124b9 to your computer and use it in GitHub Desktop.
Save caliburn1994/253966dec3ece0c020ebb8ab863124b9 to your computer and use it in GitHub Desktop.
Jacoco generate code coverage reports.
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report-aggregate</id>
<phase>test</phase>
<goals>
<goal>report-aggregate</goal><!-- other modules -->
<goal>report</goal><!-- this modules -->
</goals>
</execution>
</executions>
</plugin>
<plugins>
</build>
[...]
<pluginManagement>
<plugins>
<!-- unit test plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.0.0-M5</version>
</dependency>
</dependencies>
<configuration>
<!-- for jacoco -->
<!--suppress UnresolvedMavenProperty -->
<argLine>${argLine} -Dfile.encoding=UTF-8</argLine>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
</configuration>
</plugin>
</plugins>
</pluginManagement>
[...]
</project>
<project>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>[path]</include>
</includes>
</configuration>
</plugin>
</plugins>
[...]
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment