springboot和springcloud 和springcloud Alibaba的版本选择
一、boot和cloud版本
1.1、SpringCloud 版本号说明
- snapshot (快照),也即开发版
- Release:该版本表示最终版
版本号: 2.0.2.RELEASE 2: 主版本号。 当功能模块有较大更新或者整体架构发生变化时, 主版本号会更新 0: 次版本号。 次版本表示只是局部的一些变动。 2: 修改版本号。 一般是 bug 的修复或者是小的变动 RELEASE:表示该版本最终版。
推荐使用GA稳定版本
1.2、大致对应关系:
1.3、查下详细对应版本
如图:
这样springboot和springcloud的版本就适配完成了
1.4、方法2查下
注明:推荐采用上面cloud官网查看的方式比较好
maven查看详细版本 spring-cloud-dependencies 版本列表可查看: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies
spring-boot-starter-parent 版本列表可查看: https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent
二、cloud Alibaba 适配 springcloud
1.1、版本对应关系如图:
1.2、阿里组件版本选择
1.3、如何使用
Spring Cloud Alibaba BOM 包含了它所使用的所有依赖的版本
示例
cloud alibaba 版本锁定
<dependencyManagement> <dependencies> <!--引入spring-cloud-alibaba--> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>2021.0.1.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
引入组件(例如引入nacos)
<!--nacos注册中心 /服务注册功能 --> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> </dependency>
总结
如果版本不适配很容易出现一些乱七八糟的问题,不好排查,所以版本要适配哈