Hello,
I am trying to get SonarQube to register integration test coverage on a big and messy Maven multi-module project. It seems to only register coverage of Java classes in the same module where the test is run.
I have configured the jacoco-maven-plugin
in multiple ways, currently setting it in the pom.xml
of the module where the integration test is run. It has the prepare-agent
goal set and the report-aggregate
goal in the verify phase. I am running it in debug mode with -X
.
The jacoco.xml
has the expected coverage data. For example, a specific Java class/method has coverage data.
<method name="<init>" desc="()V" line="15">
<counter type="INSTRUCTION" missed="0" covered="3"/>
I set up the pom.xml
and the jacoco.xml
with the coverage I checked, and it gets uploaded.
[INFO] Importing 1 report(s). Turn your logs in debug mode to see the exhaustive list.
[DEBUG] Reading report '/home/jenkins/workspace/xxx/target/site/jacoco/jacoco.xml'
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=25ms
But I am still getting 0% coverage on SonarQube outside the module where the test is running. I am running out of ideas. Note that I do not have administrative access to Jenkins (CI pipeline) or SonarQube.
I think I am not crazy (yet). I am actually looking at the correct SonarQube project; I checked, and the analysis time checks out.
Any ideas on what could be going on here? Is there any way I can check without a doubt (and without admin access) that it is some sort of misconfiguration?
Using Java 17, JaCoCo 0.8.12, and SonarQube server 9.9.3.