Jacoco report with mvn without configuration
No need any configuration inside the pom.xml.
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test org.jacoco:jacoco-maven-plugin:report
Explanation
org.jacoco:jacoco-maven-plugin:prepare-agent
: Add the agent to the JVM that runs the teststest
: run the test as usualorg.jacoco:jacoco-maven-plugin:report
: generate html report
The report is generated in target/site/jacoco
Recommend way to open it:
python3 -m http.server -d target/site/jacoco 8181
then open http://localhost:8181