mavenjacoco

Jacoco report with test separated from main code


I have a spring-boot project named portal-jup, where the main code is under sub-module portal-jup-biz, and the test code is under sub-module portal-jup-test, I could generate code coverage report portal-jup/portal-jup-test/target/site/jacoco-aggregate/index.html via running mvn clean test jacoco:report-aggregate under the root path, is it possible to generate the coverage report via command mvn clean test jacoco:report, how do I configure the pom.xml to get it?


Solution

  • I found that creating an individual module to generate the jacoco report is useful, detailed in this blog: https://www.lorenzobettini.it/2017/02/jacoco-code-coverage-and-report-of-multiple-eclipse-plug-in-projects/#comment-13287