Skip to main content

Posts

Showing posts with the label Maven

Maven : Create JaCoCo Code Coverage Report

Introduction In this tutorial we will see how to setup the JaCoCo plugin to generate a code coverage report for a Maven project. In order to generate a unit test coverage report, we should have sufficient unit test cases in our application. For this tutorial, I am referring to a Maven project which has a string manipulation method. You can find this project at this GitHub location. There are a few steps that need to be taken to produce the report. Install the Maven JaCoCo plugin. Insert the following code into pom.xml. <plugin> <groupId> org.jacoco </groupId> <artifactId> jacoco-maven-plugin </artifactId> <version> 0.8.2 </version> <executions> <execution> <goals> <goal> prepare-agent </goal> </goals> </execution> <execution> <id> report </id> <phase> test <

Subscribe for latest tutorial updates

* indicates required