5

我正在使用 Gradle 5.2、spotbugs-gradle-plugin 版本 2.0.0 并尝试为我的项目生成 SpotBugs 报告。我在我的项目中使用了以下配置,但它总是创建 XML 报告而不是 html 报告。

buildscript {
    repositories {
        jcenter()
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }

    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:+'
        classpath "gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:2.0.0"
    }
}

allprojects {
    apply plugin: 'com.github.johnrengelman.shadow'
    apply plugin: 'java'
    apply plugin: 'eclipse'
    apply plugin: 'com.github.spotbugs'

    group = 'com.myproject'
    version = '1.0.0'

    repositories {
        mavenCentral()
    }

    dependencies {
        compile('com.google.cloud:google-cloud-storage:+') {
            exclude group: "com.google.guava", module: "guava"
        }
        compile group: 'org.apache.commons', name: 'commons-collections4', version: '+'
        compile group: 'com.google.guava', name: 'guava', version: '+'

        testImplementation('org.junit.jupiter:junit-jupiter:+')
    }

    test {
        useJUnitPlatform()
        testLogging {
            events "passed", "skipped", "failed"
        }
    }
}

project(':myproject') {
    dependencies {
        compile group: 'com.github.javafaker', name: 'javafaker', version: '+'
        compile group: 'org.jsonschema2pojo', name: 'jsonschema2pojo-core', version: '+'
        compile group: 'commons-lang', name: 'commons-lang', version: '+'
        compile group: 'org.mongodb', name: 'bson', version: '+'
    }
}

tasks.withType(JavaCompile) {
    options.compilerArgs << '-Xlint:unchecked'
    options.deprecation = true
}

spotbugsMain {
    reports {
        xml.enabled = false
        html.enabled = true
    }
}

我在这里做错了什么?

请提供您的输入以创建 HTML 报告而不是 XML!

4

0 回答 0