How to add JaCoCo plugin to Maven?
Adding the JaCoCo plugin to your Maven project allows you to generate code coverage reports, which is helpful for understanding how much of your code is being exercised by your tests.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version> <executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
In the <build> section of your pom.xml file, add the following snippet within the <plugins> tag.
What Is JaCoCo Plugin In Jenkins?
The name JaCoCo stands for Java code coverage it will help the developers measure, while testing the code, how much code was executed during the testing of the code. The code that is measured using jaCoCo Plugin is known as code coverage The higher code coverage indicates that a greater portion of your code is being tested.
Contact Us