Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java “斑点虫”;尚未为属性';指定任何值;spotbugslasspath'&引用;_Java_Android_Gradle_Findbugs_Spotbugs - Fatal编程技术网

Java “斑点虫”;尚未为属性';指定任何值;spotbugslasspath'&引用;

Java “斑点虫”;尚未为属性';指定任何值;spotbugslasspath'&引用;,java,android,gradle,findbugs,spotbugs,Java,Android,Gradle,Findbugs,Spotbugs,我想在我的android项目中使用spotbugs,但失败了,出现了一个例外。 运行任务:渐变->模块->其他->斑点虫 我有一个例外: 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

我想在我的android项目中使用spotbugs,但失败了,出现了一个例外。 运行任务:渐变->模块->其他->斑点虫

我有一个例外:

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'. 
spotbug.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
需要添加
spotbugsClasspath=buildscript.configurations.classpath