Jacoco coverage reporting differently in Sonarcloud

Hey there!

In our SonarCloud instance, we configure the project to point at the generated Jacoco exec file but it reliably does one of two things:

  • Reports this coverage with many missing lines
  • Reports 0 coverage for the project

This has been checked against local and what is reported on Jenkins.

Could we get some help setting this up?


1 Like

Hey Doug,

Welcome in this forum, and thank you for reaching out!

We are slowly moving away from the support of exec format, as it has many drawbacks, in profit of the XML format. For this, we now provide the dedicated JaCoCo plugin.

Before digging to much into the configuration of JaCoCO (or your analysis), did you try to produce XML reports instead of exec ? If not, could you give it a try?

It will also be easier for you to check that the content of the XML report is correct, and consequently potentially identify some JaCoCo misconfiguration.

Note that you will have to change the property to be used to sonar.coverage.jacoco.xmlReportPaths (instead of sonar.jacoco.reportPaths).


1 Like

Hey @Michael!

Can you clarify the timeline for this change please?
Will the old exec style reports still work in Sonar 7.9 LTS?

Thanks and cheers,

Related question: Will sonar.jacoco.reportPaths work in Sonar 7 LTS?

Edit: linked issue is answered already :slight_smile:

1 Like