Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead

Property 'sonar.jacoco.reportPath' is deprecated. Please use 'sonar.jacoco.reportPaths' instead.

I keep getting this message when running SonarQube through Gradle and the phrase "reportPath" does not even appear even once in the entire multi-module project. I even put the sonarqube property under allprojects to override any defaults that may be there. Any tips on how I can get rid of this error?

I am using:

allprojects {
    sonarqube {
        properties {
            property "sonar.jacoco.reportPaths", "${project.buildDir}/jacoco/test.exec"
        }
    }
}

EDIT 1:

Gradle wrapper 3.1

Am using this in the root of build.gradle

plugins {
    id "jacoco"
    id "org.sonarqube" version "2.5"
}

And tried your suggestion with

allprojects {
    sonarqube {
        properties {
            property "sonar.jacoco.reportPath", ""
            property "sonar.jacoco.reportPaths", "${project.buildDir}/jacoco/test.exec"
        }
    }
}

No dice, what do you think?

like image 202
Andrew Chen Avatar asked Jul 03 '17 18:07

Andrew Chen


People also ask

Does sonar use JaCoCo?

SonarSource analyzers do not run your tests or generate reports. They only import pre-generated reports. The reports from coverage tools (Jacoco …) are consumed by Sonarqube.

What is difference between JaCoCo and SonarQube?

JaCoCo vs SonarQube: What are the differences? JaCoCo: A code coverage library for Java. It is a free code coverage library for Java, which has been created based on the lessons learned from using and integration existing libraries for many years; SonarQube: Continuous Code Quality.

Does sonar use the JaCoCo Exclusions List?

Yes, presumably. SonarQube reads the report that JaCoCo gives it. If JaCoCo excludes certain classes, then SonarQube shouldn't get any data on them.


1 Answers

The question is, which version of the sonarQube gradle plugin you are using: https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle

The sonarqube gradle plugin sets some values per default, eg. if you use JaCoCo, which is probably the case, it automatically adds that field, besides the groovy one too.

So generally speaking, you need to wait for an update of the sonarqube gradle plugin, which gets rid of this, and is using the other config value.

Maybe you can also try to override the setting, by setting it to empty like sonar.jacoco.reportPath=

like image 80
Simon Schrottner Avatar answered Sep 21 '22 15:09

Simon Schrottner