module->other->spotbugs 我有一个异常(exception): FAILURE:-6ren">
gpt4 book ai didi

java - SpotBugs "No value has been specified for property ' SpotbugsClasspath'"

转载 作者:行者123 更新时间:2023-12-02 02:04:43 25 4
gpt4 key购买 nike

我想在我的android项目中使用spotbugs,但它失败并出现异常。运行任务:gradle->module->other->spotbugs

我有一个异常(exception):

FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':project:spotbugs'.
> No value has been specified for property 'spotbugsClasspath'.

spotbugs.gradle

apply plugin: 'com.github.spotbugs'

buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle- plugin:1.6.2"
}
}

spotbugs {
toolVersion = "3.1.3"
ignoreFailures = true
effort = 'max'
reportLevel = 'high'
excludeFilter = file("$rootProject.projectDir/rules-findbugs.xml")
}

task spotbugs (type: com.github.spotbugs.SpotBugsTask) {
println 'start spotbugs task'
pluginClasspath = project.configurations.spotbugsPlugins
// spotbugsClasspath = ???

classes = fileTree("$project.buildDir/$classDir")
source = fileTree("$project.projectDir/src/main/java/com/project/")
classpath = files()

reports {
xml.enabled = false
html.enabled = true
html.destination = file("$project.buildDir/outputs/findbugs/findbugs.html")
}
}

最佳答案

需要添加spotbugsClasspath = buildscript.configurations.classpath

关于java - SpotBugs "No value has been specified for property ' SpotbugsClasspath'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50988333/

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