1

我正在尝试使用以下build.gradle文件构建我的项目。

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

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'spring-boot'

repositories {
    maven {
        url 'https://repo.spring.io/milestone'
    }
    mavenCentral()
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-data-mongodb:1.2.2.RELEASE')
    compile('org.springframework.data:spring-data-mongodb:1.7.0.RC1')

    compile('org.springframework.cloud:spring-cloud-spring-service-connector')
    compile('org.springframework.cloud:spring-cloud-cloudfoundry-connector')

    compile 'org.springframework:spring-test:4.1.5.RELEASE'
    compile 'de.grundid.opendatalab:geojson-jackson:1.3'
    compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.5.1'
    compile 'org.apache.httpcomponents:httpclient:4.4'

    testCompile('junit:junit')
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.3'
}

我添加了里程碑存储库,因为我需要 spring-data-mongodb 1.7.0.RC1 依赖项。但是,parent-poms 的引用似乎有问题,因为 gradle 无法获取以下依赖项:org.springframework.data.build:spring-data-parent:1.6.0.RC1

它退出并出现以下错误:

Could not find org.springframework.data.build:spring-data-parent:1.6.0.RC1.
Searched in the following locations:
    https://repo.spring.io/milestone/org/springframework/data/build/spring-data-parent/1.6.0.RC1/spring-data-parent-1.6.0.RC1.pom
    https://repo.spring.io/milestone/org/springframework/data/build/spring-data-parent/1.6.0.RC1/spring-data-parent-1.6.0.RC1.jar
    https://repo1.maven.org/maven2/org/springframework/data/build/spring-data-parent/1.6.0.RC1/spring-data-parent-1.6.0.RC1.pom
    https://repo1.maven.org/maven2/org/springframework/data/build/spring-data-parent/1.6.0.RC1/spring-data-parent-1.6.0.RC1.jar

gradlew build --debug命令的输出可以在这里找到:http: //pastebin.com/seYRMFQP

该命令还向标准输出产生了以下输出: http: //pastebin.com/atcWQsKF

我已经尝试清理我的本地 gradle 缓存,但它没有解决问题。

4

2 回答 2

1

很抱歉给您带来不便,该工件目前在发布存储库中放错了位置,尽管它应该在里程碑中。

我们将尽快将其移至里程碑。在此之前,请将发布存储库添加url 'https://repo.spring.io/release'到您的构建中。

于 2015-03-10T06:32:57.533 回答
0

您在构建中定义的存储库似乎不包含您要查找的库。但似乎该库在 jcenter 中可用。要添加 jcenter,请将以下代码段添加到您的 build.gradle 文件中:

repositories {
    jcenter()
}

干杯,勒内

于 2015-03-09T18:14:41.377 回答