Spring Boot的Gradle Build失败

时间:2017-07-28 11:52:34

标签: spring gradle

我有以下gradle配置文件。使用command- gradle clean install在构建项目时出错。我想知道我的spring gradle插件版本是旧版还是Gradle构建脚本中缺少任何配置。

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.1.RELEASE")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'war'
war {
    baseName = 'webapp'
    version =  ''
}

repositories {
    mavenCentral()

}

sourceCompatibility = 1.7
targetCompatibility = 1.7

configurations {
    providedRuntime
}

dependencies {

compile("org.springframework:spring-test:4.2.4.RELEASE")

compile("org.springframework.boot:spring-boot-starter-test:1.3.1.RELEASE")
compile("com.jayway.jsonpath:json-path:2.1.0")
compile("org.springframework.boot:spring-boot-starter-web") 
compile("org.json:json:20090211")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile( "mysql:mysql-connector-java:5.1.28" )
compile("org.springframework.boot:spring-boot-starter-data-mongodb")
compile("io.springfox:springfox-swagger2:2.0.2")
compile("io.springfox:springfox-swagger-ui:2.0.2")
compile("com.google.code.gson:gson:1.7.2")
 compile('org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.0.2')
 compile('net.sourceforge.argo:argo:3.19')
testCompile('org.springframework.boot:spring-boot-starter-test')
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")


compile ("org.apache.httpcomponents:httpcore:4.3.2")
compile ("org.apache.httpcomponents:httpclient:4.3.4")

}

错误 -

board>gradle clean install

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'Dashboard'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.3.1.
RELEASE.
     Required by:
         project :
      > Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.3
.1.RELEASE.
         > Could not get resource 'https://repo1.maven.org/maven2/org/springfram
ework/boot/spring-boot-gradle-plugin/1.3.1.RELEASE/spring-boot-gradle-plugin-1.3
.1.RELEASE.pom'.
            > Host name may not contain blanks

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED in 0s

0 个答案:

没有答案