Cobertura generated coverage.xml file is not loading so sonar qube shows 0.0% coverage

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    I tried in 7.9 (LTS), 8 and latest 8.8

  • what are you trying to achieve
    Loading cobertura plugin generated coverage xml

  • what have you tried so far to achieve this
    Below are my configuration

                      <property name="sonar.java.libraries" value="${hybrishome}/hybris/bin/platform/bootstrap/bin/models.jar"/>
                      <property name="sonar.projectKey" value="fea_sonar_checks_demo" />
                      <property name="sonar.projectName" value="fea_sonar_checks_demo" />
                      <property name="sonar.projectVersion" value="0.1-SNAPSHOT" />
                  
                      <property name="sonar.login" value="2f7cb75c925a3c56182f98ca0256506cb20a0e54" />
    
    
                     <property name="sonar.host.url" value="http://localhost:9000" />
                      <property name="sonar.forceAnalysis" value="true" />
                      <property name="sonar.global.exclusions" value="**/*Test.java"/>
                      <property name="sonar.scm.provider" value="svn"/>
                      <property name="sonar.verbose" value="true"/>
                      <property name="sonar.dynamicAnalysis" value="reuseReports" />
                      <property name="sonar.java.coveragePlugin" value="cobertura" />
                      <property name="sonar.skipDesign" value="true" />
                      <property name="sonar.java.source" value="1.8" />
                      <property name="sonar.java.target" value="1.8" />
                      <property name="sonar.skipPackageDesign" value="true" />

Any help will be much appreciated. I have cobertura-1.9.4.1 and SonarQube i am trying with 7.9, 8.0 and 8.8.

In the console, when i execute ant target, i am getting
[sonar:sonar] 197/197 source files have been analyzed
[sonar:sonar] Sensor JavaSquidSensor [java] (done) | time=13432ms
[sonar:sonar] Sensor JaCoCo XML Report Importer [jacoco]
[sonar:sonar] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
[sonar:sonar] Sensor SurefireSensor [java]
[sonar:sonar] parsing [D:\Project\myWorkspace\hybris\log\integrationtests-report-for-sonar]
[sonar:sonar] Sensor SurefireSensor [java] (done) | time=222ms
[sonar:sonar] Sensor JaCoCoSensor [java]
[sonar:sonar] Sensor JaCoCoSensor [java] (done) | time=2ms
[sonar:sonar] Sensor HTML [web]
[sonar:sonar] Sensor HTML [web] (done) | time=3ms
[sonar:sonar] Sensor XML Sensor [xml]
[sonar:sonar] Sensor XML Sensor [xml] (done) | time=1ms
[sonar:sonar] ------------- Run sensors on module fea_sonar_checks_demo
[sonar:sonar] Sensor JaCoCo XML Report Importer [jacoco]
[sonar:sonar] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=1ms
[sonar:sonar] ------------- Run sensors on project

Hi,

What language are we talking about? Cobertura is only supported for Flex and Python. And which of those properties are you expecting to pass the report into analysis? I see sonar.java.coveragePlugin. But that parameter was dropped many years ago.

 
Ann

@ganncamp , thanks for the reply. We are using SAP Hybris (which is Java based application).

In our Jenkins, we have the cobertura coverage report uploaded into Sonar Qube but similar config failing in local.

Hi,

As I said, Cobertura is only supported for Flex and Python. It hasn’t been supported for Java for several years. You’ll need to look at producing JaCoCo reports. Unfortunately, the specifics of that are beyond the scope of this community.

 
HTH,
Ann

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.