是否可以將fb-contrib庫與Gradle的FindBugs plugin集成?我一直在尋找解決方案一段時間,但到目前爲止我還沒有找到任何東西...在Gradle的FindBugs插件中使用fb-contrib庫
如果有幫助,這裏是我現在的腳本。這是一項正在進行的工作,但報告生成正確。
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
}
}
}
在此先感謝您的任何答案。
如果我這樣做。例如。 '任務FindBugs的(類型:FindBugs的){ toolVersion = 「3.0.1」 ... pluginClasspath = project.configurations.findbugsPlugins }' 我沒有得到任何財產:org.gradle.api.plugins:類toolVersion .quality.FindBugs_Decorated – Kutzi
@Kutzi'toolVersion'不是任務屬性。您需要使用'findbugs {toolVersion =「3.0.1」}'全局定義該屬性。請查看原始問題以獲取此示例。 – Johnco