Sonarqube is using Cobertura instead of Jacoco

  • Project: Java 1.8.0_212
  • Springboot: 2.1.6.RELEASE
  • Sonarqube server: 6.7.6
  • Sonarqube plugin: 2.8
  • Jacoco plugin: 0.8.5

I want to use the Jacoco plugin instead of the Cobertura plugin. I try to force this with the “sonar.java.coveragePlugin=jacoco” property but looking at the logs it says that it’s looking for the Cobertura report.

I have a Jenkins pipeline that calls a script which runs the following command:
./gradlew sonarqube
-Dsonar.host.url=$sonarHostUrl
-Dsonar.language=java
-Dsonar.login=$token
-Dsonar.projectKey=$projectName
-Dsonar.projectName=$projectName
-Dsonar.projectVersion=$appVersion
-Dsonar.java.coveragePlugin=jacoco
-Dsonar.coverage.jacoco.xmlReportPaths="./build/reports/jacoco/test/jacocoTestReport.xml"

Hi,

Welcome to the community!

I’m not aware of a sonar.java.coveragePlugin property. You don’t need to tell analysis what engine you used, you simply need to pass in its reports, and it should just work from there.

To do that, you’re trying to use sonar.coverage.jacoco.xmlReportPaths, which works with current versions of SonarQube, but which probably won’t be recognized by SonarQube 6.7.6.

I urge you to upgrade SonarQube to either 7.9.2, the current LTS, or 8.2, the current version, at your earliest convenience.

 
Ann