首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >SpotBugs“未为属性‘spotbugsClasspath’指定值”

SpotBugs“未为属性‘spotbugsClasspath’指定值”
EN

Stack Overflow用户
提问于 2018-06-22 12:50:13
回答 1查看 899关注 0票数 0

我想在我的android项目中使用这些漏洞,但是它失败了,只有一个例外。运行任务:分级->模块->其他->故障

我有一个例外:

代码语言:javascript
复制
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

代码语言:javascript
复制
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")
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-06-25 07:51:28

需要添加spotbugsClasspath = buildscript.configurations.classpath

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50988333

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档