Spring Boot与Spring Cloud技术选型版本对应关系

  Spring Boot与Spring Cloud版本严格来将,Boot是以数字作为版本,Cloud是以英语大写字母开头作为版本,这些其实都是伦敦地铁站命名的版本。

一、如何选择Spring Boot版本?

github源码地址:https://github.com/spring-projects/spring-boot/wiki

springboot2.0新特性:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes,通过官网发现,Spring Boot官方强烈建议你升级到2.X以上的版本,看不懂英文的自行翻译:

从2019年10月份以后,Spring Boot2.0版本可以说是非常稳定了。从2020年开始,不推荐使用Spring Boot1.5版本了,推荐使用Spring Boot2.0版本或者更新。

从官网看SpringBoot版本:https://spring.io/projects/spring-boot#learn,目前Spring Boot最新版本如下图:

使用最新版本就是最好的吗?其实并不是这样的,这需要与Spring Cloud版本相对应才行。

 

二、如何选择Spring Cloud版本?

github源码地址:https://github.com/spring-projects/spring-cloud/wiki由于Spring Cloud源码地址非常的懒,Spring Cloud GitHub上面不在进行维护了,如果读者有兴趣请看Spring Cloud官网:https://spring.io/projects/spring-cloud

springcloud版本命名规则:

Spring Cloud 采用了英国伦敦地铁站的名称来进行命名,并由地铁站名称字母A-Z以此类推的形式来发布迭代的版本。

Spring Cloud 是一个由许多子项目组成的综合项目,各自项目有不同的发布节奏,为了管理 Spring Cloud 与各个子项目的版本依赖关系,发布了一个清单,其中包括了某个 Spring Cloud 版本对应的子项目版本。为了避免 Spring Cloud 版本号与子项目版本号混淆,Spring Cloud 版本采用了名称而非版本号的命名,这些版本的名字采用了伦敦地铁站的名字,根据字母表的顺序来对应版本的时间顺序。

例如 Angel 是第一个版本,Brixton 是第二个版本。当 Spring Cloud 的发布内容积累到临界点或者一个重大的 Bug 被解决之后,会发布一个 “service releases”版本,简称 SRX 版本,比如 Greenwich.SR2 就是 Spring Cloud 发布的 Greenwich 版本的第二个 SRX 版本。

从官网看SpringCloud版本:https://spring.io/projects/spring-cloud#learn,目前Spring Cloud最新版本如下图:

 

三、Spring Cloud与Spring Boot之间的依赖关系如何查看

访问官网地址:https://spring.io/projects/spring-cloud#overview,Spring Cloud和Spring Boot版本对应关系表格如下:

Spring Cloud Version SpringBoot Version
Hoxton 2.2.x
Greenwich 2.1.x
Finchley 2.0.x
Edgware 1.5.x
Dalston 1.5.x

  如果你想使用 Spring Cloud Hoxton 最新版本,Spring Boot 版本必须对应使用 2.2.x 版本,x可以是1、2、3和4等,然而你想使用 Spring Cloud Greenwich 版本,Spring Boot 版本不更改为 2.1.x 版本的话,可能会无法正确引入项目依赖,进行报错或者是不支持此版本。

版本依赖关系:

  • Finchley 是基于 Spring Boot 2.0.x 构建的不再使用 Spring Boot 1.5.x。

  • Dalston 和 Edgware 是基于 Spring Boot 1.5.x 构建的,不支持 Spring Boot 2.0.x。

  • Camden 构建于 Spring Boot 1.4.x,但依然能支持 Spring Boot 1.5.x。

所以说以前的A-D版本基本上不在推荐使用了,如果现在要使用 Spring Cloud 版本,个人觉得 Greenwich 版本还是比较稳定的,配合 Spring Boot 2.1.x 版本进行使用。

更详细的版本对应查看方法:

  浏览器访问 https://start.spring.io/actuator/info 监控信息请求地址,如果刚开始查看 JSON 串返回结果看不懂,个人推荐在谷歌浏览器扩展程序下载一个叫 JSONView 插件。非常的好用,该插能够自动识别 JSON 请求数据格式。

我们一起来看一下效果吧:

猜你喜欢

转载自www.cnblogs.com/wessonshin/p/12677131.html