Not getting code coverage in SonarCloud from Bitbucket (Java17)

I am not getting the coverage when sonar runs through bitbucket, when I generate it locally the report is generated correctly

Here is my .yml file

Hey there.

Have you confirmed that the JaCoCo report is being produced by your Maven build? Does it appear to be picked up by the sonar:sonar task? Look for information like this in the logs:

INFO: Sensor JaCoCo XML Report Importer [jacoco]

As always, this is a good resource for making sure the reports are generated correctly and tied to the verify goal.

I made the changes you suggested, the problem is more that the report is generated in the main branch, but not in any other branches or pull request, any suggestion why?

You’ll want to make sure the changes you’ve made have trickled down to your existing feature branches / pull requests – in any case, I would really suggest checking your Maven build/test logs making sure the report is actually being generated (SonarCloud only reads the report, it doesn’t produce it).

If the JaCoCo XML report is being produced in other branches / pull requests (and you’ve confirmed this) but SonarCloud isn’t reading it in, then we can try and help troubleshoot.