Sonar code coverage issue with java gradle+bamboo

Hello,

we have a problem with java sonar analisys using gradle and bamboo. It doesn’t find coverage report. It shows coverage always as 0.
Below are necessary details

Gradle sonarqube plugin:
id “org.sonarqube” version “3.0”

java version “1.8”

Our gradle properties:

sonarqube {
properties {
property “sonar.host.url”, "http://sonar.xxxx

	.com:8080"
    property "sonar.projectName", project.name
    property "sonar.projectVersion", version
    property "sonar.projectKey", project.name
    property 'sonar.exclusions', '**/*ReportingApplication**, **/*EnvironmentPreparedListener**, **/model/**, **/exception/**, **/mappers/**,**/*StoredProcedure.**,**/gen/**'
	property "sonar.coverage.jacoco.xmlReportPaths", "${project.buildDir}/reports/jacoco.xml"
}

}

Jacoco configuration:
test{
finalizedBy jacocoTestReport
}

jacocoTestReport{
dependsOn test
}

jacoco{
toolVersion = “0.8.5”
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
//to create coverage report in html
html.destination file(“${buildDir}/reports/coverage”)
//for XML
xml.destination file(“${buildDir}/reports/jacoco.xml”)
}
}

LOGS of sonarTask:
build 28-Dec-2023 00:48:02 > Task :sonarqube
build 28-Dec-2023 00:48:02 Sensor FindBugs Sensor [findbugs] (done) | time=5836ms
build 28-Dec-2023 00:48:02 Sensor SurefireSensor [java]
build 28-Dec-2023 00:48:02 parsing [/usr/appl/cie/home/prodcie/bamboo-agent-5/bamboo-home/xml-data/build-dir/JOB1/build/test-results/test]
build 28-Dec-2023 00:48:02 Sensor SurefireSensor [java] (done) | time=56ms
build 28-Dec-2023 00:48:02 Sensor JaCoCoSensor [java]
build 28-Dec-2023 00:48:02 Both ‘sonar.jacoco.reportPath’ and ‘sonar.coverage.jacoco.xmlReportPaths’ were set. ‘sonar.jacoco.reportPath’ is deprecated therefore, only ‘sonar.coverage.jacoco.xmlReportPaths’ will be taken into account.
build 28-Dec-2023 00:48:02 Both ‘sonar.jacoco.reportPaths’ and ‘sonar.coverage.jacoco.xmlReportPaths’ were set. ‘sonar.jacoco.reportPaths’ is deprecated therefore, only ‘sonar.coverage.jacoco.xmlReportPaths’ will be taken into account.
build 28-Dec-2023 00:48:02 Sensor JaCoCoSensor [java] (done) | time=1ms
build 28-Dec-2023 00:48:02 Sensor JavaXmlSensor [java]
build 28-Dec-2023 00:48:02 Sensor JavaXmlSensor [java] (done) | time=1ms
build 28-Dec-2023 00:48:02 Sensor Analyzer for “php.ini” files [php]
build 28-Dec-2023 00:48:02 Sensor Analyzer for “php.ini” files [php] (done) | time=3ms
build 28-Dec-2023 00:48:02 Sensor Zero Coverage Sensor
build 28-Dec-2023 00:48:02 Sensor Zero Coverage Sensor (done) | time=26ms

Hey there.

What version of SonarQube are you using? You can find this information in the footer of your SonarQube instance.

Hi Colin,

We are using Sonar-Version 6.7.1 (build 35068)

Oof, that’s an incredibly old version of SonarQube!

You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

6.7.1 → 7.9.6 → 8.9.10 → 9.9.3 → 10.3 (last step optional)

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

If the issue persists after upgrade, please come back to us.

Thanks Colin, I’ll do the same and will get back to you if there is any issue.