Let us now include code coverage from the unit tests of our project in the site documentation.
Use the following steps to generate code coverage reports for a site:
Open the Maven project for which you want to do this (for instance,
project-with-documentation
).Add the following code in the
<build>
section of thepom.xml
file:<plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.2.201409121644</version> <executions> <execution> <id>default-prepare-agent</id> <goals> <goal>prepare-agent</goal> </goals> </execution> </executions> </plugin>
Add the following code in the
reporting
section of thepom.xml
file:<plugin> <groupId>org.jacoco</groupId> <artifactId...