java 不推荐使用属性“sonar.jacoco.reportPath”。请改用“sonar.jacoco.reportPaths”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/44892248/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:23:50  来源:igfitidea点击:

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

javagradlesonarqubejacoco

提问by Andrew Chen

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

不推荐使用属性“sonar.jacoco.reportPath”。请改用“sonar.jacoco.reportPaths”。

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?

通过 Gradle 运行 SonarQube 时,我不断收到此消息,并且在整个多模块项目中,“reportPath”这个短语甚至没有出现过一次。我什至将 sonarqube 属性放在 allprojects 下以覆盖可能存在的任何默认值。关于如何摆脱此错误的任何提示?

I am using:

我在用:

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

EDIT 1:

编辑 1:

Gradle wrapper 3.1

Gradle 包装器 3.1

Am using this in the root of build.gradle

我在 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?

没有骰子,你怎么看?

采纳答案by Simon Schrottner

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

问题是,您使用的是哪个版本的 sonarQube gradle 插件: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.

sonarqube gradle 插件默认设置一些值,例如。如果您使用 JaCoCo(可能是这种情况),它会自动添加该字段,除了 groovy 字段之外。

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.

所以一般来说,你需要等待 sonarqube gradle 插件的更新,它摆脱了这个,并使用其他配置值。

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

也许您也可以尝试覆盖设置,将其设置为空,例如 sonar.jacoco.reportPath=