问题
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?
回答1:
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=
来源:https://stackoverflow.com/questions/44892248/property-sonar-jacoco-reportpath-is-deprecated-please-use-sonar-jacoco-repor