【发布时间】:2017-07-20 15:41:06
【问题描述】:
我正在尝试在 Eclipse 中设置我的第一个 gradle 项目,但我在构建 gradle 时遇到了问题。我已经从 spring.io 复制了 build.gradle,但它仍然无法正确构建。我得到任务':compileJava'的执行失败。我的 build.gradle 文件看起来像这样
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.1.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
jar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty")
// end::jetty[]
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator")
// end::actuator[]
testCompile("junit:junit")
}
【问题讨论】:
-
完整输出是什么?请在构建命令中使用“-s”参数。
-
@MartinLinha 错误详情pastebin.com/PgAmm0Sx
标签: java spring eclipse gradle