I tried to find the answer on this forum, but no luck so far.
Our setup is:
we have the 8.4 entreprise version.
whenever someone create a PR or merge into our master branch, we use a Jenkins pipeline where the docker sonar scanner (https://github.com/SonarSource/sonar-scanner-cli-docker) is used to scan the project.
I have the following behaviour for different java 8 projects:
when I merge a gradle project (that produce a jacoco.xml file), I get code coverage in SonarQube
when I merge a maven project (that produce a jacoco.xml file with jacoco 0.8.5), I get code coverage in SonarQube
when I create a PR for a gradle project (that produce a jacoco.xml file), I get PR code coverage in SonarQube
when I create a PR for a maven project (that produce a jacoco.xml file with jacoco 0.8.5), I DON’T get PR code coverage in SonarQube
i tried to check any issue with the jacoco.xml file, but didn’t find anything significant.
and AFAIK, the sonar-project.properties is quite standard across all our repo.
Something like
Presumably you’re using the Sonar Scanner for Gradle and the Sonar Scanner for Maven for Gradle and Maven projects, respectively. Those scanners read most of their values from the build environment, so there’s little need to pass parameters explicitly and certainly no need to create a sonar-project.properties file; those scanners don’t read it.
Probably your next step in debugging this is to add -Dsonar.scanner.dumpToFile=[file name] to the command line for working and non-working analyses. Then you can compare what values analysis is actually getting and go from there.