Spring Cloud Alibaba与Spring Boot、Spring Cloud版本对应关系

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

大家好,又见面了,我是你们的朋友全栈君。

一、前言

在搭建SpringCloud项目环境架构的时候,需要选择SpringBootSpringCloud进行兼容的版本号,因此对于选择SpringBoot版本与SpringCloud版本的对应关系很重要,如果版本关系不对应,常见的会遇见项目启动不起来,怪异的则会是你的项目出现一些诡异的问题,查资料也不好查。下面就收集一下SpringBootSpringCloud版本之间的对应关系,在搭建项目框架或者学习时按照对应的版本区间进行选择即可,避免走一些不必要的弯路。

1. 历史版本图

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格式如下:

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

三、如何选择SpringBoot与SpringCloud版本号

项目搭建初期,如何对SpringBootSpringCloud的一个相互兼容性版本号进行选择,这是很重要的一步,例如SpringCloudHoxton.SR3这个版本,他对应的"Spring Boot >=2.2.0.M4 and <2.3.0.BUILD-SNAPSHOT"版本,意思就是如果选择使用SpringCloudHoxton.SR3这个版本,那么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>

四、SpringBoot、SpringCloud、SpringCloudAlibaba版本对应关系

由于Spring Cloud基于Spring Boot构建,而Spring Cloud Alibaba又基于Spring Cloud Common的规范实现,所以当我们使用“Spring Cloud Alibaba`来构建微服务应用的时候,需要知道这三者之间的版本关系。

下表整理了目前Spring Cloud Alibaba的版本与Spring BootSpring Cloud版本的兼容关系:

1. 毕业版本依赖关系(推荐使用)

Spring Cloud Version Spring Cloud Alibaba Version Spring Boot Version
Spring Cloud Hoxton.SR8 2.2.3.RELEASE 2.3.2.RELEASE
Spring Cloud Greenwich.SR6 2.1.3.RELEASE 2.1.13.RELEASE
Spring Cloud Hoxton.SR8 2.2.2.RELEASE 2.3.2.RELEASE
Spring Cloud Hoxton.SR3 2.2.1.RELEASE 2.2.5.RELEASE
Spring Cloud Hoxton.RELEASE 2.2.0.RELEASE 2.2.X.RELEASE
Spring Cloud Greenwich 2.1.2.RELEASE 2.1.X.RELEASE
Spring Cloud Finchley 2.0.3.RELEASE 2.0.X.RELEASE
Spring Cloud Edgware 1.5.1.RELEASE(停止维护,建议升级) 1.5.X.RELEASE

五. Spring Cloud Alibaba与组件版本关系

Spring Cloud Alibaba是基于Spring Cloud Common的规范实现,而Spring Cloud Alibaba的各个微服务组件依赖于Spring Cloud Alibaba自身,因此我们需要知道Spring Cloud Alibaba与其自身微服务组件之间的版本关系。

下表整理了目前Spring Cloud Alibaba的版本与SentinelNacosRocketMQDubboSeata版本的兼容关系:

1. 组件版本关系

Spring Cloud Alibaba Version Sentinel Version Nacos Version RocketMQ Version Dubbo Version Seata Version
2.2.3.RELEASE or 2.1.3.RELEASE or 2.0.3.RELEASE 1.8.0 1.3.3 4.4.0 2.7.8 1.3.0
2.2.1.RELEASE or 2.1.2.RELEASE or 2.0.2.RELEASE 1.7.1 1.2.1 4.4.0 2.7.6 1.2.0
2.2.0.RELEASE 1.7.1 1.1.4 4.4.0 2.7.4.1 1.0.0
2.1.1.RELEASE or 2.0.1.RELEASE or 1.5.1.RELEASE 1.7.0 1.1.4 4.4.0 2.7.3 0.9.0
2.1.0.RELEASE or 2.0.0.RELEASE or 1.5.0.RELEASE 1.6.3 1.1.1 4.4.0 2.7.3 0.7.1

六、依赖管理

Spring Cloud Alibaba BOM 包含了它所使用的所有依赖的版本。

1. RELEASE 版本

Spring Cloud Hoxton

如果需要使用 Spring Cloud Hoxton 版本,请在 dependencyManagement中添加如下配置

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    <version>2.2.3.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

然后在dependencies 中添加自己所需使用的依赖即可使用。

Spring Cloud Greenwich

如果需要使用 Spring Cloud Greenwich版本,请在 dependencyManagement中添加如下配置

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    <version>2.1.3.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

然后在 dependencies中添加自己所需使用的依赖即可使用。

Spring Cloud Finchley

如果需要使用 Spring Cloud Finchley版本,请在 dependencyManagement中添加如下配置

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    <version>2.0.3.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

然后在dependencies中添加自己所需使用的依赖即可使用。

Spring Cloud Edgware

如果需要使用 Spring Cloud Edgware 版本,请在 dependencyManagement中添加如下配置

<dependency>
    <groupId>com.alibaba.cloud</groupId>
    <artifactId>spring-cloud-alibaba-dependencies</artifactId>
    <version>1.5.1.RELEASE</version>
    <type>pom</type>
    <scope>import</scope>
</dependency>

然后在 dependencies中添加自己所需使用的依赖即可使用。

2. 版本管理规范

项目的版本号格式为 x.x.x 的形式,其中 x 的数值类型为数字,从 0 开始取值,且不限于 0~9 这个范围。项目处于孵化器阶段时,第一位版本号固定使用 0,即版本号为 0.x.x 的格式。

由于 `Spring Boot 1 和 Spring Boot 2 在 Actuator 模块的接口和注解有很大的变更,且 spring-cloud-commons 从 1.x.x 版本升级到 2.0.0 版本也有较大的变更,因此我们采取跟 SpringBoot 版本号一致的版本:

  • 1.5.x 版本适用于 Spring Boot 1.5.x
  • 2.0.x 版本适用于 Spring Boot 2.0.x
  • 2.1.x 版本适用于 Spring Boot 2.1.x
  • 2.2.x 版本适用于 Spring Boot 2.2.x

七、参考文档

1.Spring-Cloud-Alibaba版本说明:https://github.com/alibaba/spring-cloud-alibaba/wiki/版本说明

3.SpringCloudAlibaba中文社区地址: https://github.com/alibaba/spring-cloud-alibaba/blob/master/README-zh.md

2.SpringCloud官方文档: https://cloud.spring.io/spring-cloud-static/spring-cloud-gateway/2.2.1.RELEASE/reference/html/

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/136776.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Particle_filter 粒子滤波器 的学习笔记

    Particle_filter 粒子滤波器 的学习笔记粒子滤波是一种基于蒙特卡洛模拟的非线性滤波方法,其核心思想是用随机采样的粒子表达概率密度分布。粒子滤波的三个重要步骤为:1)粒子采样,从建议分布中抽取一组粒子;2)粒子加权,根据观测概率分布,重要

    2022年8月6日
    1
  • UGUI合批drawcall高的原因「建议收藏」

    UGUI合批drawcall高的原因「建议收藏」各个UI界面Batches高的原因通用原因1.UI重叠打断合批增加一倍的drawcall特别是列表里面的重叠https://zhuanlan.zhihu.com/p/431118062.空图片例如ScrollRect已经下面的View可考虑使用空的Text或者写一个类继承MaskableGraphic不绘制使用UpdateGeometry不绘制3.都是散图可考虑系统按钮作为一个图集活动图标作为一个图集…

    2022年9月18日
    0
  • Basename_dirname

    Basename_dirnamebasenamebasename去除文件名的目录部分和后缀部分。返回一个字符串参数的基本文件名称。语法:basenameNAME[SUFFIX]basenameOPTION用法:$basename/home/me/desktop/test.txt输出:test.txt可以指定suffix参数:$basename/home/me/d

    2025年5月31日
    0
  • java 入门书籍(java7)

    java 入门书籍(java7)一、Java从入门到精通《Java从入门到精通(第3版)》从初学者角度出发,通过通俗易懂的语言、丰富多彩的实例,详细介绍了使用Java语言进行程序开发需要掌握的知识。《Java从入门到精通(第3版)》编辑推荐:“软件开发视频大讲堂”丛书系清华社“视频大讲堂”重点大系之一。该大系包括多个子系列,每个子系列的图书在其同品种的图书中销售名列前茅,其中:4个品种荣获“全行业优秀畅销

    2022年5月24日
    41
  • CSS常用颜色代码对照表

    CSS常用颜色代码对照表FFFFFF#DDDDDD#AAAAAA#888888#666666#444444#000000#FFB7DD#FF88C2#FF44AA #FF0088 #C10066 #A20055 #8C0044 #FFCCCC#FF8888#FF3333 

    2022年5月17日
    42
  • 编译成功了,运行为什么会失败_如何编译内核

    编译成功了,运行为什么会失败_如何编译内核1:首先在内核文件夹当中选择编译配置文件arch/arm/configs下选则davinci_dm368_ipnc_defconfig_nand(nandflash启动),davinci_dm368_ipnc_defconfig_nfs(nfs文件系统启动)2:makemenuconfig保存退出3:makeARCH=armCROSS_COMPILE=arm_v5t_le-

    2022年8月13日
    1

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号