【发布时间】:2015-05-16 10:21:27
【问题描述】:
我正在尝试使用 gradle jettyRun 运行我的 Spring Boot 应用程序,但是当 gradle 编译Java 时出现这些错误:
alberto@alberto-desktop:~/Credito/PalmasServer$ gradle jettyRun :编译Java FAILURE:构建失败并出现异常。 什么地方出了错: 无法解析配置 ':compile' 的所有依赖项。 找不到 org.springframework.data:spring-data-rest-webmvc:。 要求: :PalmasServer:未指定 找不到 org.hsqldb:hsqldb:。 要求: :PalmasServer:未指定 找不到 com.h2database:h2:。 要求: :PalmasServer:未指定 找不到 nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:。 要求: :PalmasServer:未指定 找不到 org.thymeleaf.extras:thymeleaf-extras-springsecurity3:。 要求: :PalmasServer:未指定 找不到 org.thymeleaf:thymeleaf-spring4:。 要求: :PalmasServer:未指定 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。 构建失败
总时间:35.664 秒
这是我的 build.gradle 文件:
buildscript { ext { springBootVersion = '1.1.9.RELEASE' } repositories { maven { url "http://repo.spring.io/libs-snapshot" } mavenLocal() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.9.RELEASE") } } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'war' apply plugin: 'jetty' apply plugin: 'application' sourceCompatibility = 1.7 targetCompatibility = 1.7 war { version = '0.1.0' } repositories { mavenCentral() maven { url "http://repo.spring.io/libs-snapshot" } maven { url "http://maven.springframework.org/milestone" } flatDir { dirs 'lib' } } dependencies { compile "xerces:xercesImpl:2.9.0" compile "net.sourceforge.nekohtml:nekohtml:1.9.12" compile "nekohtml:nekodtd:0.1.11" compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}") compile("org.springframework.boot:spring-boot-starter-tomcat:${springBootVersion}") compile("org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}") compile("org.springframework.boot:spring-boot-starter-aop:${springBootVersion}") compile("org.springframework.boot:spring-boot-starter-test:${springBootVersion}") compile("org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}") compile("org.springframework.data:spring-data-rest-webmvc") compile("org.springframework.boot:spring-boot-starter-security:1.0.2.RELEASE") compile("org.springframework.security.oauth:spring-security-oauth2:2.0.0.RC2") compile("org.springframework.security.oauth:spring-security-oauth2-javaconfig:1.0.0.M1") compile("org.hsqldb:hsqldb") compile("com.h2database:h2") compile("com.google.guava:guava:17.0") compile("org.apache.commons:commons-lang3:3.3.2") compile("org.apache.httpcomponents:httpclient:4.3.4") compile("com.squareup.retrofit:retrofit:1.6.0") compile("commons-io:commons-io:2.4") compile("com.github.davidmarquis:fluent-interface-proxy:1.3.0") compile ("org.springframework.boot:spring-boot-starter-security:1.0.2.RELEASE") compile ("javax.servlet:jstl:1.2") compile ("commons-fileupload:commons-fileupload:1.3.1") testCompile("junit:junit") compile("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect") compile("org.thymeleaf.extras:thymeleaf-extras-springsecurity3") compile("org.thymeleaf:thymeleaf-spring4") def poiVersion = "3.10.1" compile "org.apache.poi:poi:${poiVersion}" compile "org.apache.poi:poi-ooxml:${poiVersion}" compile "org.apache.poi:ooxml-schemas:1.1" } jar { baseName = 'gs-uploading-files' version = '0.1.0' } task wrapper(type: Wrapper) { gradleVersion = '1.11' }
为什么当我在 Eclipse 中运行时一切正常????
还有什么想法吗?
【问题讨论】:
标签: gradle dependencies spring-boot