运行 gradle jettyRun 错误

running gradle jettyRun error

我正在尝试 运行 我的 spring 使用 gradle jettyRun 启动应用程序但是当 gradle 编译 Java 时出现这些错误:

alberto@alberto-desktop:~/Credito/PalmasServer$ gradle jettyRun :compileJava FAILURE: Build failed with an exception. What went wrong: Could not resolve all dependencies for configuration ':compile'. Could not find org.springframework.data:spring-data-rest-webmvc:. Required by: :PalmasServer:unspecified Could not find org.hsqldb:hsqldb:. Required by: :PalmasServer:unspecified Could not find com.h2database:h2:. Required by: :PalmasServer:unspecified Could not find nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:. Required by: :PalmasServer:unspecified Could not find org.thymeleaf.extras:thymeleaf-extras-springsecurity3:. Required by: :PalmasServer:unspecified Could not find org.thymeleaf:thymeleaf-spring4:. Required by: :PalmasServer:unspecified Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED

总时间: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 中 运行ning 一切正常????

还有其他想法吗?

尝试添加以下代码:

compile fileTree(dir: 'lib', include: ['*.jar'])

dependencies块。