关于spring:SpringBoot-和-Spring-Cloud版本依赖关系

5次阅读

共计 1585 个字符,预计需要花费 4 分钟才能阅读完成。

SpringBoot 和 Spring Cloud 版本依赖关系
以下内容均体现在 Spring Cloud 官网。

0)Spring Cloud 版本名变更
从 2020.0.X 版本开始,Spring Cloud 版本的命名形式批改为工夫线的形式。

而 SpringCloud 之前的版本名称是伦敦地铁站的站名命名,且首字母程序与版本工夫程序统一,如:

Angel
Brixton
Camden
Dalston
Edgware
Finchley
Greenwich
Hoxton

还是伦敦地铁站的站名命名版本时,当 SpringCloud 的公布内容积攒到临界点或者一个重大 Bug 被解决后,会公布一个 ”Service Releases” 版本,简称 ”SR” 版本(参考官网:https://github.com/spring-clo…)。其中也包含相干组件的版本,比方:Spring Cloud Netflix 2.2.9 RELEASE。

而从 2020.0.X 版本开始,则是数字递增的形式:

SpringCloud 与 SpringBoot 的版本对应关系,能够通过以下三种形式来确定:

1)SpringCloud 公布版本与 SpringBoot 版本兼容性的表格

表中形容的是一个版本范畴;比方与 SpringCloud Hoxton 版本适配的 SpringBoot 版本应该是 2.2.x 版本 或 2.3.x(SR5 开始以上)的版本。

2)拜访 https://start.spring.io/actua…

JSON 格式化后的 Spring Cloud 版本内容如下:

3)Spring Cloud 参考文章中会举荐应用 Spring Boot 版本

这种形式最精准。

2、SpringCloud 和 SpringCloudAlibaba 版本对应关系
spring Cloud Alibaba 官网版本申明:https://github.com/alibaba/sp…。

2)Spring Cloud alibaba 组件版本关系

3、依赖治理
Spring Cloud Alibaba BOM 中蕴含了它所应用的所有依赖的版本。

咱们只须要在 <dependencyManagement> 标签中 增加如下内容:

<project>

.....

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>2.3.7.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <!-- 整合 spring cloud-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Hoxton.SR8</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
        <!-- 整合 spring cloud alibaba-->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-alibaba-dependencies</artifactId>
            <version>2.2.5.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

</project>

正文完
 0