gpt4 book ai didi

gradle - 在 Gradle 的 FindBugs 插件中使用 fb-contrib 库

转载 作者:行者123 更新时间:2023-12-04 11:24:54 28 4
gpt4 key购买 nike

是否可以集成fb-contrib带有 Gradle 的库 FindBugs plugin ?我一直在寻找解决方案一段时间,但到目前为止我还没有找到任何东西......

如果有帮助,这是我现在拥有的脚本。这是一项正在进行的工作,但报告已正确生成。

apply plugin: "findbugs"

task findbugs(type: FindBugs) {

classes = fileTree(project.rootDir.absolutePath).include("**/*.class");
source = fileTree(project.rootDir.absolutePath).include("**/*.java");
classpath = files()

findbugs {
toolVersion = "2.0.3"
ignoreFailures = true
effort = "max"
reportLevel = "low"
reportsDir = file("${projectDir}/reports/findbugs")
sourceSets = [it.sourceSets.main, it.sourceSets.test]
}

tasks.withType(FindBugs) {
reports {
xml.enabled = false
html.enabled = true
}
}
}

提前感谢您的任何回答。

最佳答案

我刚刚遇到了同样的问题。我能够解决它如下:

apply plugin: 'findbugs'

dependencies {
// We need to manually set this first, or the plugin is not loaded
findbugs 'com.google.code.findbugs:findbugs:3.0.0'
findbugs configurations.findbugsPlugins.dependencies

// To keep everything tidy, we set these apart
findbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:6.0.0'
}

task findbugs(type: FindBugs) {
// Add all your config here ...

pluginClasspath = project.configurations.findbugsPlugins
}

希望有帮助!

您可以添加更多 Findbugs 插件,只需将它们添加到 findbugsPlugins 的依赖项下即可。

关于gradle - 在 Gradle 的 FindBugs 插件中使用 fb-contrib 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21737193/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com