简体   繁体   English

spring-cloud 和 spring-cloud-gcp 有通用的 BOM 文件吗?

[英]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 :目前在我的项目中,我在build.gradle导入了 2 个 bom 依赖项(用于 spring cloud 和 spring cloud-gcp):

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 .我怀疑这是否正确,因为spring-cloud可能与spring-cloud-gcp版本不兼容。 But I was not able to find a common BOM file.但是我找不到通用的 BOM 文件。

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.导入 Spring Cloud GCP BOM 允许您省略指定其他 Spring Cloud GCP 依赖项的版本。

Generally you'll want to align Spring Cloud GCP with Spring Cloud.通常,您需要使 Spring Cloud GCP 与 Spring Cloud 保持一致。 That is to say, a version of Spring Cloud GCP was tested/built on a specific release train of Spring Cloud.也就是说,一个版本的 Spring Cloud GCP 是在 Spring Cloud 的特定版本系列上测试/构建的。

So for your sample, looking at the parent for v1.2.1.RELEASE I see:因此,对于您的示例,查看 v1.2.1.RELEASE 的父级,我看到:

https://github.com/spring-cloud/spring-cloud-gcp/blob/v1.2.1.RELEASE/spring-cloud-gcp-dependencies/pom.xml#L8 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.所以 Spring Cloud GCP v1.2.1.RELEASE 是建立在 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 .现在,如果我查看 Spring Cloud 发行版系列的发行说明, 我会发现 Hoxton.SR1 是 Spring Cloud v2.2.1.RELEASE 属于.

You have Greenwich.SR3 in your sample.您的示例中有 Greenwich.SR3。 You are at least (3) versions behind for Spring Cloud, (4) if we count Hoxton.SR1.如果算上 Hoxton.SR1,您至少落后 (3) 个 Spring Cloud 版本,(4) 个版本。

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.我还应该注意,如果您使用https://start.spring.io/并生成具有一些 Spring Cloud GCP 依赖项的 Gradle 项目,则省略​​ Spring Cloud GCP BOM。 So later versions of Spring Cloud may be managing the GCP dependencies.所以更高版本的 Spring Cloud 可能会管理 GCP 依赖项。 You can try upgrading to latest Spring Cloud release train, then remove the Spring Cloud GCP BOM and see what happens.您可以尝试升级到最新的 Spring Cloud 版本系列,然后删除 Spring Cloud GCP BOM,看看会发生什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring-Cloud配置服务器忽略配置属性文件 - Spring-Cloud configuration server ignores configuration properties file spring-cloud如何使用端点 - spring-cloud how to use Endpoints 如何在Spring-Cloud中将ConsulDiscoveryClient与Zuul和Sidecar一起使用 - How do I use the ConsulDiscoveryClient with Zuul and Sidecar in Spring-Cloud 微服务系统中服务之间的分布式事务,使用spring-cloud - Distributed transaction among services in a microservice system, using spring-cloud Springboot 版本从 2.1.6 升级到 2.2.1 和 spring-cloud 问题 - Springboot Version upgrade from 2.1.6 to 2.2.1 and spring-cloud issue spring-cloud-gcp-starter-bigquery 忽略属性文件中的 spring.cloud.gcp.credentials.location - spring-cloud-gcp-starter-bigquery ignores spring.cloud.gcp.credentials.location from property file 春云公用区中的“寄存器管理”是什么? - What is “register-management” in spring-cloud commons? 运行spring-cloud微服务项目,服务器没有启动? - While running spring-cloud microservices project, the server is not starting up? spring-cloud bus kafka RemoteApplicationEvent originService 刷新时为 null - spring-cloud bus kafka RemoteApplicationEvent originService is null when refresh spring-cloud / spring-cloud-netflix,设置hystrix原始ID - spring-cloud/spring-cloud-netflix, setting the hystrix origin id
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM