Vreddy_Ark
(Vreddy Ark)
February 11, 2022, 6:21pm
1
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
Colin
(Colin)
February 14, 2022, 4:48pm
2
Hey there.
It looks like you’re using Gradle, which means a few things:
Vreddy_Ark:
.soanr.properties
You should not use a sonar-project.properties file when using the Scanner for Gradle , instead putting details in your build.gradle file
There is a great guide for importing JaCoCo coverage data with Gradle here:
Importing JaCoCo coverage report in XML format
Version 5.12 of our SonarJava analyzer deprecated uses JaCoCo’s binary format (.exec files) to import coverage. This binary format is internal to the JaCoCo project, and as such there are no guarantees for backward compatibility, so it should not be used for integration purposes.
As a replacement, when you scan a project with Sonar scanner, we use a special Jacoco report analyzer, which imports your JaCoCo’s XML coverage report, and this is the pr…
Vreddy_Ark
(Vreddy Ark)
February 14, 2022, 10:34pm
3
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.
Vreddy_Ark
(Vreddy Ark)
February 15, 2022, 8:01pm
5
is there any of setting up sonar properties other than using build.gradle
system
(system)
Closed
February 22, 2022, 8:01pm
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.