I am somewhat new with continuous systems and have been struggling to get Sonar to recognize JaCoCo’s coverage analysis.
[INFO] --- jacoco-maven-plugin:0.8.7:prepare-agent (prepare-agent) @ stargate --- [INFO] argLine set to -javaagent:/home/runner/.m2/repository/org/jacoco/org.jacoco.agent/0.8.7/org.jacoco.agent-0.8.7-runtime.jar=destfile=/home/runner/work/Stargate-Bukkit/Stargate-Bukkit/target/jacoco.exec [INFO] --- jacoco-maven-plugin:0.8.7:report (report) @ stargate --- [INFO] Loading execution data file /home/runner/work/Stargate-Bukkit/Stargate-Bukkit/target/jacoco.exec [INFO] Analyzed bundle 'StarGate' with 135 classes [INFO] Sensor JaCoCo XML Report Importer [jacoco] [INFO] 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml [INFO] Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list. [INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=102ms [INFO] Sensor Zero Coverage Sensor [INFO] Sensor Zero Coverage Sensor (done) | time=0ms
Unfortunately, no matter what I do, I can’t seem to get sonar to detect jacoco (and its analysis of our unit tests). Our current prototype’s coverage is 56% which, while far from great, is more than the 0% I have been able to get sonar to show.
I’ve tried setting
sonar.coverage.jacoco.xmlReportPaths to a variety of values (including leaving it blank), yet have not yet been able to get any results.