欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SpringCloud和Springboot版本对应关系

程序员文章站 2022-06-06 11:21:19
...

一、前言

在搭建SpringCloud项目环境架构的时候,Springboot版本与SpringCloud版本对应关系很重要,如果版本不对应,常见的会遇见项目启动不起来,怪异的会是项目出现一些诡异的问题。
Release train Spring Boot compatibility

Spring Cloud Release Train Spring Boot Version
Hoxton 2.2.x
Greenwich 2.1.x
Finchley 2.0.x
Edgware 1.5.x
Dalston 1.5.x
Camden 1.4.x
Brixton 1.3.x
Angle 1.2.x

注意: SpringBoot1.5.x及以下版本官方不再提供维护,建议使用SpringBoot2.0.x以上版本,相对应的SpringCloud版本也最好不要使用。

二、查看版本关系

访问Spring官方地址,可获取SpringBootSpringCloud版本对应信息:

https://start.spring.io/actuator/info

SpringCloud和Springboot版本对应关系

JSON["bom-ranges"]["spring-cloud"]["Finchley.M9"]◣
Path:
JSON["bom-ranges"]["spring-cloud"]["Finchley.M9"]

Key:
Finchley.M9
 : Copy deURI deBase64 aLine Copied!

Modify
+Expand all -Collapse all Expand node Scroll to node

Show value Show img Show array leng Show ico
JSON
git
commit
time2020-04-17T16:18:36Z
id7f707c1
branch7f707c17bed34a13b5bc9d5d58c71fc5a901c335
build
version0.0.1-SNAPSHOT
artifactstart-site
namestart.spring.io website
versions
initializr0.9.0.BUILD-SNAPSHOT
spring-boot2.2.6.RELEASE
groupio.spring.start
time2020-04-17T16:19:53.303Z
bom-ranges
azure
2.0.10Spring Boot >=2.0.0.RELEASE and <2.1.0.RELEASE
2.1.7Spring Boot >=2.1.0.RELEASE and <2.2.0.M1
2.2.0Spring Boot >=2.2.0.M1
codecentric-spring-boot-admin
2.0.6Spring Boot >=2.0.0.M1 and <2.1.0.M1
2.1.6Spring Boot >=2.1.0.M1 and <2.2.0.M1
2.2.1Spring Boot >=2.2.0.M1
solace-spring-boot
1.0.0Spring Boot >=2.2.0.RELEASE and <2.3.0.M1
solace-spring-cloud
1.0.0Spring Boot >=2.2.0.RELEASE and <2.3.0.M1
spring-cloud
Finchley.M2Spring Boot >=2.0.0.M3 and <2.0.0.M5
Finchley.M3Spring Boot >=2.0.0.M5 and <=2.0.0.M5
Finchley.M4Spring Boot >=2.0.0.M6 and <=2.0.0.M6
Finchley.M5Spring Boot >=2.0.0.M7 and <=2.0.0.M7
Finchley.M6Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1
Finchley.M7Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2
Finchley.M9Spring Boot >=2.0.0.RELEASE and <=2.0.0.RELEASE
Finchley.RC1Spring Boot >=2.0.1.RELEASE and <2.0.2.RELEASE
Finchley.RC2Spring Boot >=2.0.2.RELEASE and <2.0.3.RELEASE
Finchley.SR4Spring Boot >=2.0.3.RELEASE and <2.0.999.BUILD-SNAPSHOT
Finchley.BUILD-SNAPSHOTSpring Boot >=2.0.999.BUILD-SNAPSHOT and <2.1.0.M3
Greenwich.M1Spring Boot >=2.1.0.M3 and <2.1.0.RELEASE
Greenwich.SR5Spring Boot >=2.1.0.RELEASE and <2.1.14.BUILD-SNAPSHOT
Greenwich.BUILD-SNAPSHOTSpring Boot >=2.1.14.BUILD-SNAPSHOT and <2.2.0.M4
Hoxton.SR3Spring Boot >=2.2.0.M4 and <2.3.0.BUILD-SNAPSHOT
Hoxton.BUILD-SNAPSHOTSpring Boot >=2.3.0.BUILD-SNAPSHOT
spring-cloud-alibaba
2.2.0.RELEASESpring Boot >=2.2.0.RELEASE and <2.3.0.M1
spring-cloud-services
2.0.3.RELEASESpring Boot >=2.0.0.RELEASE and <2.1.0.RELEASE
2.1.7.RELEASESpring Boot >=2.1.0.RELEASE and <2.2.0.RELEASE
2.2.3.RELEASESpring Boot >=2.2.0.RELEASE and <2.3.0.M1
spring-statemachine
2.0.0.M4Spring Boot >=2.0.0.RC1 and <=2.0.0.RC1
2.0.0.M5Spring Boot >=2.0.0.RC2 and <=2.0.0.RC2
2.0.1.RELEASESpring Boot >=2.0.0.RELEASE
vaadin
10.0.17Spring Boot >=2.0.0.M1 and <2.1.0.M1
14.1.25Spring Boot >=2.1.0.M1
dependency-ranges
okta
1.2.1Spring Boot >=2.1.2.RELEASE and <2.2.0.M1
1.4.0Spring Boot >=2.2.0.M1
mybatis
2.0.1Spring Boot >=2.0.0.RELEASE and <2.1.0.RELEASE
2.1.2Spring Boot >=2.1.0.RELEASE
geode
1.2.6.RELEASESpring Boot >=2.2.0.M5 and <2.3.0.M1
1.3.0.M3Spring Boot >=2.3.0.M1 and <2.3.0.BUILD-SNAPSHOT
1.3.0.BUILD-SNAPSHOTSpring Boot >=2.3.0.BUILD-SNAPSHOT
camel
2.22.4Spring Boot >=2.0.0.M1 and <2.1.0.M1
2.25.1Spring Boot >=2.1.0.M1 and <2.2.0.M1
3.2.0Spring Boot >=2.2.0.M1

三、如何使用

比如SpringCloudHoxton.SR3这个版本,他对应的"Spring Boot >=2.2.0.M4 and <2.3.0.BUILD-SNAPSHOT",意思是SpringBoot的版本大于等于2.2.0小于2.3.0

1. 引入SpringCloud版本管理

官方提供了管理Spring Cloud 每个版本兼容的pom,引入下面即可:

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

2. 使用Spring Boot

Spring Boot可以像父工程那样管理自己内部的兼容版本号

<parent>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-parent</artifactId>
   <version>2.2.5.RELEASE</version>
   <relativePath/> <!-- lookup parent from repository -->
</parent>

SpringCloud和Springboot版本对应关系