Code Coverage reports are not getting reflected on sonarqube dashboard

I am using Sonarqube Enterprise Edition Version 7.9.1 (build 27448)
I am having the scoverage.xml report generated using command:

mvn verify sonar:sonar

getting output as:

Run completed in 2 minutes, 39 seconds.
Total number of tests run: 10
Suites: completed 5, aborted 0
Tests: succeeded 10, failed 0, canceled 0, ignored 0, pending 0
All tests passed.
[INFO] <<< scoverage-maven-plugin:1.4.1:report (default) < [scoverage]test @ ccr-reporting <<<
[INFO] --- scoverage-maven-plugin:1.4.1:report (default) @ ccr-reporting ---
[INFO] Reading scoverage instrumentation [/mrit_cm2/rawasum/ds-rfds-falconnet/falcon-agents/dispatcher-tasks/ccr-reporting/target/scoverage-data/scoverage.coverage]...
[INFO] Reading scoverage measurements [/mrit_cm2/rawasum/ds-rfds-falconnet/falcon-agents/dispatcher-tasks/ccr-reporting/target/scoverage-data/scoverage.measurements.*]...
[INFO] Generating coverage reports...
[INFO] Written Cobertura XML report [/mrit_cm2/rawasum/ds-rfds-falconnet/falcon-agents/dispatcher-tasks/ccr-reporting/target/cobertura.xml]
[INFO] Written XML coverage report [/mrit_cm2/rawasum/ds-rfds-falconnet/falcon-agents/dispatcher-tasks/ccr-reporting/target/scoverage.xml]
[INFO] Written HTML coverage report [/mrit_cm2/rawasum/ds-rfds-falconnet/falcon-agents/dispatcher-tasks/ccr-reporting/target/site/scoverage/index.html]
[INFO] Statement coverage.: 36.07%
[INFO] Branch coverage....: 6.25%
[INFO] Coverage reports completed.

And analysis is also successfull:

[INFO] 5 files to be analyzed
[INFO] 5/5 files analyzed
[INFO] Calculating CPD for 13 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 151ms, dir size=384 KB
[INFO] Analysis report compressed in 100ms, zip size=127 KB
[INFO] Analysis report uploaded in 244ms
[INFO] ANALYSIS SUCCESSFUL, you can browse to ---

But the dashboard is showing 0.0% code coverage

here is my pom.xml having these important data. I have mentioned the jacoco, surefire plugin. My scoverage.xml report is getting generated having the branch coverage and statement coverage.


                <!-- Sets the VM argument line used when unit tests are run. -->

                                        <!-- Sets the path to the file which contains the execution data. -->
                                        <!-- Sets the output directory for the code coverage report. -->

What is missing? How can I resolve?


Welcome to the community!

What does your analysis log say about importing (or not) the JaCoCo report? Have you verified the file actually exists?


If you are talking about jacoco.exec it is not getting generated. Even if I mention in my pom, it was not getting generated.


In fact, we no longer import jacoco.exec, but jacoco.xml. You’ll need to get it generated, and unfortunately doing so is out of scope for this community.