【发布时间】:2018-11-27 02:34:15
【问题描述】:
不确定我的 build.gradle 文件有什么问题。我对 gradle 很陌生,所以我不理解这个错误。它允许我运行 gradle build、gradle init、gradle 任务等,但是当我运行“gradle run”时构建失败
这是我的 build.gradle:
plugins {
id 'com.github.spotbugs' version '1.6.5'
}
apply plugin: 'application'
///////////////////////////////////////////////////////////////////////////
// Definint Main class
///////////////////////////////////////////////////////////////////////////
mainClassName = 'main.java.main'
repositories {
mavenCentral()
}
dependencies {
compile "junit:junit:4.12"
}
///////////////////////////////////////////////////////////////////////////
// Configure Checkstyle
///////////////////////////////////////////////////////////////////////////
apply plugin: 'checkstyle'
checkstyle {
// Keep checkstyle a little quieter
ignoreFailures = true
showViolations = false
}
tasks.withType(Checkstyle) {
reports {
html.enabled = true
xml.enabled = false
}
}
checkstyle {
toolVersion = "8.8"
}
///////////////////////////////////////////////////////////////////////////
// Configure SpotBugs
///////////////////////////////////////////////////////////////////////////
// The part below needs to be included for Spotbugs
spotbugs {
toolVersion = '3.1.1'
}
// // To generate an HTML report instead of XML
tasks.withType(com.github.spotbugs.SpotBugsTask) {
reports {
xml.enabled = false
html.enabled = true
}
}
【问题讨论】: