Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Management with import bom does not work in Spring Boot 2.3 with multi module Gradle project #23510

Closed
dietzsch opened this issue Sep 28, 2020 · 1 comment
Labels
status: invalid An issue that we don't feel is valid

Comments

@dietzsch
Copy link

dietzsch commented Sep 28, 2020

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.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 28, 2020
@wilkinsona
Copy link
Member

Support for Spring Cloud Connectors was deprecated in Spring Boot 2.2 and removed in Spring Boot 2.3.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants