gradle - 无法解析 org.springframework.cloud :spring-cloud-starter-config

标签 gradle spring-cloud-config

我正在使用 gradle 构建,这是我的 build.gradle

我在 gradle 文件中遗漏了什么

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/libs-milestone" }
    maven { url "https://repo.spring.io/libs-snapshot" }     
}

apply plugin: 'org.springframework.boot'
apply plugin: 'java'
apply plugin: 'javac2'
apply plugin: 'docker'

dependencies {
   compile project(':services')
   compile 'org.springframework.boot:spring-boot-starter-web'
   compile('org.springframework.cloud:spring-cloud-starter-config')
   compile('org.springframework.boot:spring-boot-starter-actuator')
   compile 'org.jetbrains:annotations:13.0'
   runtime 'org.aspectj:aspectjweaver'

   testCompile 'junit:junit'
   testCompile 'org.springframework.boot:spring-boot-starter-test'
   testRuntime "com.jayway.awaitility:awaitility:$awaitilityVersion"
   testRuntime 'com.jayway.jsonpath:json-path'
}

apply plugin: 'java'

springBoot {
executable = true
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Finchley.BUILD-SNAPSHOT"
}
}

docker {
baseImage "java:8"
}

task buildDocker(type: Docker, dependsOn: build) {
applicationName = "ldp-data-fetcher"
exposePort(8080)
addFile("${buildDir}/libs/app-0.1-SNAPSHOT.jar", "/opt/jmg/app-0.1-SNAPSHOT.jar")
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

最佳答案

尝试使用:

dependencies { 
  [...]
  compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-config', version: '2.0.1.RELEASE'
}

代替:
compile('org.springframework.cloud:spring-cloud-starter-config')

关于gradle - 无法解析 org.springframework.cloud :spring-cloud-starter-config,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51609822/

相关文章:

java - 从 Spring Cloud Config Server 获取配置时 Spring 配置文件排序不正确

spring-cloud-config - 没有定义 spring.config.import 属性

android - Gradle 错误使用 fbutton

java - 是否有任何标准方法可以使用 gradle 从 intellij 运行 java 项目?

java - 将 Gradle 测试装置与 PowerMock 结合使用

java - 升级到 Edgware.SR3 时没有 RsaProperties 类型的合格 bean

Spring 云配置服务 - Git 与 Native

android - 无法解析 : com. google.android :flexbox:1. 1.0

maven - 401 Unauthorized 从 GitHub Packages 使用 Gradle 下载公共(public)包

java - Spring Cloud配置云无需继承父级