Jacoco coverage reporting differently in Sonarcloud


(Douglas DeMars) #1

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?
Thanks

Doug


(Michael Gumowski) #2

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).

Regards,
Michael