My jacoco report were being uploaded to sonarcloud

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    plugins {
    id “org.sonarqube” version “3.3”
    }
  • what are you trying to achieve
    the reports are being generated in the path build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml
    but sonar cloud was not able to take these coverages show the coverage report in sonar cloud
    from feature branch to not default branch {dev}
  • what have you tried so far to achieve this

get the code coverage parameter on all the pros and in sonar cloud

fyi
.soanr.properties

sonar.projectVersion=1.0
sonar.projectKey=xxxxxxxxxxxx
sonar.organization=xxxxxxxxx
sonar.projectName=xxxxxxx
sonar.java.source=8
sonar.modules=data
sonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml

Hey there.

It looks like you’re using Gradle, which means a few things:

  1. You should not use a sonar-project.properties file when using the Scanner for Gradle, instead putting details in your build.gradle file
  2. There is a great guide for importing JaCoCo coverage data with Gradle here:

if I try to use as you mentioned to

You are running CI analysis while Automatic Analysis is enabled. Please consider disabling one or the other.

sonarqube {
   properties {
     property "sonar.host.url", "https://sonarcloud.io"
     property "sonar.organization", "xxxxxxxxx"
     property "sonar.projectKey", "xxxxxxxxx"
     property "sonar.projectName", "xxxxxxxx"
     property "sonar.sourceEncoding", "UTF-8"
     property "sonar.core.codeCoveragePlugin", "jacoco"
     property "sonar.sources", "app"
     property "sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/jacocoTestReport/jacocoTestReport.xml"
   }
}

is there any way to pick up info from .sonarcloud.properties for Gradle or is it only way to mention the properties in build.gradle as mentioned above.

Hey there.

See here:

is there any of setting up sonar properties other than using build.gradle

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