We are attempting to run sonar-scanner v4.0.0.1744 to parse our Gradle generated Jacoco coverage xml report. We have tried to upload our java coverage reports with sonar-scanner in two different ways:
- Using
sonar.jacoco.reportPaths
– This worked for us and we see coverage results on Sonarqube, but required us to set thesonar.java.binaries
,sonar.test.binaries
options to point to the appropriate Java build directories. Our only issue with using “reportPaths” is that it is deprecated, so we want to switch to using thesonar.coverage.jacoco.xmlReportPaths
option instead. - Using
sonar.coverage.jacoco.xmlReportPaths
– This does not work for us. We point it to the xml report path and we set all the same flags as the one above except for thesonar.jacoco.reportPaths
.
We were targeting pushing results to Sonarqube Developer Edition v7.3. To make sure it was not a bug with the webapp/deployment, we stood up another separate temporary deployment of Sonarqube Community Edition v7.9.2 LTS server, and attempted to push the results there with the same version of sonarqube scanner with the same two methods above; we still get 0.0% coverage with the sonar.coverage.jacoco.xmlReportPaths
option.
Is there a bug with scanner, or are we doing something wrong when invoking scanner?
Thank you!