SonarQube not reading Jacoco.xml after upgrade Developer EditionVersion 9.9

Must-share information (formatted with Markdown):

  • Sonarqube Developer EditionVersion 9.9
  • Gradle, Jenkins
  • started in debug mode, removed exclusions, updated to jacoco.xml instead of exec

Ours is a Java multi module project, Gradle is the build tool,
We recently upgraded Sonar.
For this we removed the Sonar plugins from build.gradle and created a sonar-project.properties file with following information:

sonar.projectKey=
sonar.projectName=
sonar.language=java
sonar.java.binaries=**/build/classes
sonar.sources=projectname/src
sonar.tests=services/src/test
sonar.java.coveragePlugin=jacoco
sonar.coverage.jacoco.xmlReportPaths=**/build/jacoco/jacocoreport.xml

I see jacocoreport.xml with all listed issues

ISSUE:
When we run a build on Jenkins, Sonar qube is not reading the coverage and it is showing 0.0% coverage.

It used work all fine with older version of Sonar, i.e prior to this weekend’s upgrade.

Please help…

Hi,

Welcome to the community!

What did you upgrade from?

Also, which scanner are you analyzing with? If you’re building with Gradle, you should be analyzing with the SonarScanner for Gradle.

Why? The SonarScanner for Gradle isn’t going to read that properties file…

 
Ann

Hi Ann,
I see sonarqube is reading the jacoco.xml files, but it is not reading multiple files,
When I run the build locally, I see all the files. But in the logs it is reading only one file.

image

Another Issue:
I tried merging these files but build.gradle is not able to merge xml like it used to merge execs.
We upgraded to SonarQube scanner using Java 17 version.
It would be great if you have any docs explaining how to merge with gradle, as exec merging was good. But issue with xml merging.

Hi,

Screenshots of logs really aren’t helpful, and particularly not redacted ones. I can only refer you to the docs.

 
Ann