SpringCloud实战前准备工作

目录

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.csdn.net/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.csdn.net/article/details/129121906

以上!

猜你喜欢

转载自blog.csdn.net/wangyongfei5000/article/details/129861707