I have a multi-module Gradle project, where I use Spring Boot and Spring Cloud. In the root build.gradle I have the following code:
buildscript {
repositories {
mavenLocal()
maven {
url "https://plugins.gradle.org/m2/"
}
dependencies {
classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.4.RELEASE'
}
}
subprojects {
ext {
springCloudDependenciesVersion = "Hoxton.SR8"
}
repositories {
maven { url "https://repo.spring.io/plugins-release" }
maven { url "https://repo.spring.io/release" }
maven { url "https://repo.spring.io/milestone" }
}
if (new File(projectDir, 'src').exists()) {
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'maven'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.bosch.de.bics.build.cf-manifest'
}
}
and in one of the child modules the build.gradle looks like this:
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudDependenciesVersion}"
}
}
dependencies {
// Spring
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-web"
compile "org.springframework.boot:spring-boot-starter-amqp"
compile "org.springframework.boot:spring-boot-starter-jdbc"
compile "org.springframework.boot:spring-boot-starter-data-jpa"
compile "org.springframework.boot:spring-boot-starter-data-mongodb"
// Spring Cloud
compile "org.springframework.cloud:spring-cloud-starter-netflix-hystrix"
compile "org.springframework.cloud:spring-cloud-spring-service-connector"
compile "org.springframework.cloud:spring-cloud-cloudfoundry-connector"
compile "org.springframework.cloud:spring-cloud-localconfig-connector"
compile "org.springframework.cloud:spring-cloud-starter-security"
// Testing
testCompile "org.springframework.boot:spring-boot-starter-test"
testCompile "org.codehaus.groovy:groovy-all:2.5.13"
testCompile "org.spockframework:spock-spring:1.3-groovy-2.5"
testCompile "cglib:cglib-nodep:3.3.0"
}
With Spring Boot 2.2.x this builds successful, but when switching to Spring Boot 2.3 the build fails with the following error message:
Could not find org.springframework.cloud:spring-cloud-spring-service-connector:. Could not find org.springframework.cloud:spring-cloud-cloudfoundry-connector:. Could not find org.springframework.cloud:spring-cloud-localconfig-connector:.
It seems that the dependencyManagement with import bom does not worky anymore in this context. Unfortunately the documentation does not mention any behaviour change between Spring Boot 2.2 and 2.3 with respect to this.
Comment From: wilkinsona
Support for Spring Cloud Connectors was deprecated in Spring Boot 2.2 and removed in Spring Boot 2.3.