Spring Cloud和Spring Boot的版本对应匹配依赖关系

如果您希望将Spring Cloud添加到现有的Spring Boot应用程序中,那么第一步是确定您应该使用的Spring Cloud版本。您在应用程序中使用的版本将取决于您使用的Spring Boot版本。

下表概述了Spring Cloud的哪个版本映射到Spring Boot的哪个版本,即Spring Cloud对Spring Boot版本的匹配依赖关系,如果版本匹配错误,程序启动会报莫名其妙的错误。

Spring Cloud 版本Spring Boot 版本

2021.0.x aka Jubilee

2.6.x

2020.0.x aka Ilford

2.4.x, 2.5.x (Starting with 2020.0.3)

Hoxton

2.2.x, 2.3.x (Starting with SR5)

Greenwich

2.1.x

Finchley

2.0.x

Edgware

1.5.x

Dalston

1.5.x

以最新的spring boot 2.6.x版本为例,需要使用spring cloud 2021.0.1版本。

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>2021.0.1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

官方地址:Spring Cloud

### Spring CloudSpring Cloud Alibaba与Spring Boot兼容版本对照表 对于项目开发而言,选择合适的框架组合至关重要。以下是经过整理的Spring CloudSpring Cloud Alibaba以及Spring Boot之间的稳定兼容版本列表: | Spring Cloud | Spring Cloud Alibaba | Spring Boot | |--| | Hoxton.SR8 | 2.2.5.RELEASE | 2.3.4.RELEASE | | 2020.0.3 (Ilford SR3) | 2021.1.LTS (1.5.7) | 2.5.9 | | 2021.0.5 (Edgware SR5)| 2021.1.LTS (1.5.7) | 2.6.7 | 上述表格展示了不同版本间的相互支持情况[^1]。 当构建基于微服务架构的应用程序时,确保所使用的组件之间具有良好的兼容性可以减少许多不必要的麻烦并提高系统的稳定性[^2]。 ```java // 示例代码用于展示如何在pom.xml中配置依赖项 <dependencies> <!-- Spring Boot Starter Parent --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>2.3.4.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <!-- Spring Cloud Dependency Management --> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>Hoxton.SR8</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <!-- Spring Cloud Alibaba Dependency Management --> <dependencyManagement> <dependencies> <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> </dependencies> ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大龄码农有梦想

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值