SpringCloud和Springboot版本對應關係

一、前言

在搭建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

在這裏插入圖片描述

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>

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章