SpringCloud实战前准备工作

文章介绍了SpringCloud与SpringBoot的版本对应关系,强调了正确匹配版本的重要性,提供了从JDK基础环境搭建、Maven配置到SpringBoot依赖的选择以及IntelliJIDEA开发环境准备的详细步骤。此外,还提到了其他相关技术如Mybatis、Camel和Picocli与SpringBoot的版本兼容性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

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

2、Spring Cloud开发环境准备

2.1 JDK基础环境搭建

2.2 Maven构建环境搭建

2.3 SpringBoot 2.0.x依赖配置

2.4 IntelliJ IDEA开发软件


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

Spring Cloud最早是从2014年推出的,在推出的前期更新迭代速度非常快,频繁发布新版本,目前更趋于稳定,变化稍慢一些。

Spring Cloud的版本并不是传统的使用数字的方式标识,而是使用诸如:Angel、Brixton、Camden......等伦敦的地名来命名版本,版本的先后顺序使用字母表A-Z的先后来标识,,现在已经进入F版本;
 

Finchley 兼容Spring Boot 2.0.x,不兼容Spring Boot 1.5.x

Edgware 兼容Spring Boot 1.5.x,不兼容Spring Boot 2.0.x

Dalston 兼容Spring Boot 1.5.x,不兼容Spring Boot 2.0.x

Camden 兼容Spring Boot 1.4.x,也兼容Spring Boot 1.5.x

Brixton 兼容Spring Boot 1.3.x,也兼容Spring Boot 1.4.x

Angel 兼容Spring Boot 1.2.x

在我们引入spring cloud的时候,一定要注意spring cloud和spring boot的版本是有对应关系的,如果使用了不对应的版本,往往会导致一些奇奇怪怪得bug;

具体对应关系可以通过官方给的网址来获取:https://start.spring.io/actuator/info

截至到目前最新的对应关系:

{

"git": {

"branch": "85e49c952e7a24cef2886b488089880e9791ba37",

"commit": {

"id": "85e49c9",

"time": "2023-03-21T20:31:52Z"

}

},

"build": {

"version": "0.0.1-SNAPSHOT",

"artifact": "start-site",

"versions": {

"spring-boot": "3.0.2",

"initializr": "0.20.0-SNAPSHOT"

},

"name": "start.spring.io website",

"time": "2023-03-21T20:32:47.276Z",

"group": "io.spring.start"

},

"bom-ranges": {

"codecentric-spring-boot-admin": {

"2.4.3": "Spring Boot >=2.3.0.M1 and <2.5.0-M1",

"2.5.6": "Spring Boot >=2.5.0.M1 and <2.6.0-M1",

"2.6.8": "Spring Boot >=2.6.0.M1 and <2.7.0-M1",

"2.7.4": "Spring Boot >=2.7.0.M1 and <3.0.0-M1",

"3.0.2": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"

},

"solace-spring-boot": {

"1.1.0": "Spring Boot >=2.3.0.M1 and <2.6.0-M1",

"1.2.2": "Spring Boot >=2.6.0.M1 and <3.0.0-M1"

},

"solace-spring-cloud": {

"1.1.1": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",

"2.1.0": "Spring Boot >=2.4.0.M1 and <2.6.0-M1",

"2.3.2": "Spring Boot >=2.6.0.M1 and <3.0.0-M1"

},

"spring-cloud": {

"Hoxton.SR12": "Spring Boot >=2.2.0.RELEASE and <2.4.0.M1",

"2020.0.6": "Spring Boot >=2.4.0.M1 and <2.6.0-M1",

"2021.0.0-M1": "Spring Boot >=2.6.0-M1 and <2.6.0-M3",

"2021.0.0-M3": "Spring Boot >=2.6.0-M3 and <2.6.0-RC1",

"2021.0.0-RC1": "Spring Boot >=2.6.0-RC1 and <2.6.1",

"2021.0.6": "Spring Boot >=2.6.1 and <3.0.0-M1",

"2022.0.0-M1": "Spring Boot >=3.0.0-M1 and <3.0.0-M2",

"2022.0.0-M2": "Spring Boot >=3.0.0-M2 and <3.0.0-M3",

"2022.0.0-M3": "Spring Boot >=3.0.0-M3 and <3.0.0-M4",

"2022.0.0-M4": "Spring Boot >=3.0.0-M4 and <3.0.0-M5",

"2022.0.0-M5": "Spring Boot >=3.0.0-M5 and <3.0.0-RC1",

"2022.0.0-RC1": "Spring Boot >=3.0.0-RC1 and <3.0.0-RC2",

"2022.0.0-RC2": "Spring Boot >=3.0.0-RC2 and <3.0.0",

"2022.0.1": "Spring Boot >=3.0.0 and <3.1.0-M1"

},

"spring-cloud-azure": {

"4.6.0": "Spring Boot >=2.5.0.M1 and <3.0.0-M1",

"5.0.0": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"

},

"spring-cloud-gcp": {

"2.0.11": "Spring Boot >=2.4.0-M1 and <2.6.0-M1",

"3.4.6": "Spring Boot >=2.6.0-M1 and <3.0.0-M1",

"4.1.2": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"

},

"spring-cloud-services": {

"2.3.0.RELEASE": "Spring Boot >=2.3.0.RELEASE and <2.4.0-M1",

"2.4.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",

"3.3.0": "Spring Boot >=2.5.0-M1 and <2.6.0-M1",

"3.4.0": "Spring Boot >=2.6.0-M1 and <2.7.0-M1",

"3.5.0": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",

"4.0.0": "Spring Boot >=3.0.0 and <3.1.0-M1"

},

"spring-shell": {

"2.1.6": "Spring Boot >=2.7.0 and <3.0.0-M1",

"3.0.0": "Spring Boot >=3.0.0 and <3.1.0-M1"

},

"vaadin": {

"14.9.6": "Spring Boot >=2.1.0.RELEASE and <2.6.0-M1",

"23.2.15": "Spring Boot >=2.6.0-M1 and <2.7.0-M1",

"23.3.5": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",

"24.0.0": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"

},

"wavefront": {

"2.0.2": "Spring Boot >=2.1.0.RELEASE and <2.4.0-M1",

"2.1.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",

"2.2.2": "Spring Boot >=2.5.0-M1 and <2.7.0-M1",

"2.3.4": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",

"3.0.1": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"

}

},

"dependency-ranges": {

"okta": {

"1.4.0": "Spring Boot >=2.2.0.RELEASE and <2.4.0-M1",

"1.5.1": "Spring Boot >=2.4.0-M1 and <2.4.1",

"2.0.1": "Spring Boot >=2.4.1 and <2.5.0-M1",

"2.1.6": "Spring Boot >=2.5.0-M1 and <3.0.0-M1",

"3.0.3": "Spring Boot >=3.0.0-M1 and <3.1.0-M1",

"managed": "Spring Boot >=3.1.0-M1"

},

"mybatis": {

"2.1.4": "Spring Boot >=2.1.0.RELEASE and <2.5.0-M1",

"2.2.2": "Spring Boot >=2.5.0-M1 and <2.7.0-M1",

"2.3.0": "Spring Boot >=2.7.0-M1 and <3.0.0-M1",

"3.0.0": "Spring Boot >=3.0.0-M1"

},

"camel": {

"3.5.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",

"3.10.0": "Spring Boot >=2.4.0.M1 and <2.5.0-M1",

"3.13.0": "Spring Boot >=2.5.0.M1 and <2.6.0-M1",

"3.17.0": "Spring Boot >=2.6.0.M1 and <2.7.0-M1",

"3.20.2": "Spring Boot >=2.7.0.M1 and <3.0.0-M1",

"4.0.0-M2": "Spring Boot >=3.0.0-M1 and <3.1.0-M1"

},

"picocli": {

"4.7.0": "Spring Boot >=2.5.0.RELEASE and <3.1.0-M1"

},

"open-service-broker": {

"3.2.0": "Spring Boot >=2.3.0.M1 and <2.4.0-M1",

"3.3.1": "Spring Boot >=2.4.0-M1 and <2.5.0-M1",

"3.4.1": "Spring Boot >=2.5.0-M1 and <2.6.0-M1",

"3.5.0": "Spring Boot >=2.6.0-M1 and <2.7.0-M1"

}

}

}

其中,我们页能看查看mybatis(数据库与实体映射组件)、camel(Apache Camel是一个集成框架,它具有用于集成各种应用程序的编程模型。)、picocli(Picocli 致力于以最简洁的方式来创建一个基于JVM的功能强大的命令行程序)和spring boot的版本对应关系。

2、Spring Cloud开发环境准备

开发环境的准备主要涉及三个方面:JDK、Maven、Spring Tools 4 for Eclipse。

2.1 JDK基础环境搭建

JDK 的版本用 1.8 即可,环境变量大家自行去配置。配置好环境变量,在命令行中输入“java -version”能够显示出版本信息即可,如图所示。

具体可参考我前面的文章:

Windows如何安装Java 11 环境

https://fcworld.blog.youkuaiyun.com/article/details/129098665

2.2 Maven构建环境搭建

Maven 是用于项目构建的,教程所用的版本是 3.6。安装完之后也需要配置环境变量,配置好后同样需要在命令行中输入“mvn -version”进行检测。这里不再赘述。

2.3 SpringBoot 2.0.x依赖配置

 选择与你所使用的Spring CLoud版本一致的SpringBoot版本。

2.4 IntelliJ IDEA开发软件

参考文章:

Java开发工具使用和代码规范配置

https://fcworld.blog.youkuaiyun.com/article/details/129121906

以上!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

老王随聊

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

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

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

打赏作者

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

抵扣说明:

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

余额充值