简体   繁体   中英

is there common BOM file for spring-cloud and spring-cloud-gcp?

Currently in my project I import 2 bom dependencies(for spring cloud and for spring cloud-gcp) inside my build.gradle :

dependencyManagement {
    imports {
        mavenBom "org.springframework.cloud:spring-cloud-dependencies:Greenwich.SR3"
        mavenBom "org.springframework.cloud:spring-cloud-gcp-dependencies:1.2.1.RELEASE"
    }
}

I have doubts if it is correct way because spring-cloud might have incompatible version with spring-cloud-gcp . But I was not able to find a common BOM file.

Could you please clarify this question?

This is correct. Importing the Spring Cloud GCP BOM allows you to omit specifying the version of other Spring Cloud GCP dependencies.

Generally you'll want to align Spring Cloud GCP with Spring Cloud. That is to say, a version of Spring Cloud GCP was tested/built on a specific release train of Spring Cloud.

So for your sample, looking at the parent for v1.2.1.RELEASE I see:

https://github.com/spring-cloud/spring-cloud-gcp/blob/v1.2.1.RELEASE/spring-cloud-gcp-dependencies/pom.xml#L8

<parent>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-dependencies-parent</artifactId>
    <version>2.2.1.RELEASE</version>
    <relativePath/>
</parent>

So Spring Cloud GCP v1.2.1.RELEASE was build on top of Spring Cloud v2.2.1.RELEASE.

Now If I examine the release notes for the Spring Cloud release train, I see that Hoxton.SR1 is the release train that Spring Cloud v2.2.1.RELEASE was part of .

You have Greenwich.SR3 in your sample. You are at least (3) versions behind for Spring Cloud, (4) if we count Hoxton.SR1.

So if you haven't run into incompatibility issues now, you will in the future since it's likely internally one of the libraries is using a deprecated method or something else internal that changed.


I should also note that if you use https://start.spring.io/ and generate a Gradle project with some Spring Cloud GCP dependencies, the Spring Cloud GCP BOM is omitted. So later versions of Spring Cloud may be managing the GCP dependencies. You can try upgrading to latest Spring Cloud release train, then remove the Spring Cloud GCP BOM and see what happens.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM