You need to enable JavaScript to run this app.
导航
如何修改 POM 文件中 Nacos 接入版本?
最近更新时间:2025.03.20 10:18:15首次发布时间:2023.02.01 17:54:44
我的收藏
有用
有用
无用
无用

如果默认的 Nacos 依赖的组件存在兼容问题,需要在 POM 文件中手动添加版本依赖。

操作步骤

根据 组件版本版关系,在 POM 的文档中添加 Nacos Version 版本依赖,示例如下。
alt

<dependency>
    <groupId>com.alibaba.nacos</groupId>
    <artifactId>nacos-client</artifactId>
    <version>2.0.4</version>
</dependency>    

Spring Cloud 组件版本关系

Spring Cloud Alibaba 版本及其自身所适配的各组件对应版本如下。

注意

  • Spring Cloud 2.2.9.RELEASE 和 2.2.8.RELEASE 默认使用的 Nacos 2.1.0 版本存在兼容性问题,需要替换至 Nacos 2.1.2 版本。操作方法参见上文 操作步骤
  • Spring Cloud 2.2.7.RELEASE 版本默认使用的 Nacos 2.0.3 版本存在兼容性问题,需要替换至 Nacos 2.0.4 版本。操作方法参见上文 操作步骤
  • Spring Cloud Dubbo 从 2021.0.1.0 起已被移除出主干,不再随主干演进。
Spring Cloud Alibaba VersionSentinel VersionNacos VersionRocketMQ VersionDubbo VersionSeata Version
2.2.10-RC11.8.62.2.04.9.4~1.6.1
2022.0.0.0-RC11.8.62.2.1-RC4.9.4~1.6.1
2.2.9.RELEASE1.8.52.1.04.9.4~1.5.2
2021.0.4.01.8.52.0.44.9.4~1.5.2
2.2.8.RELEASE1.8.42.1.04.9.3~1.5.1
2021.0.1.01.8.31.4.24.9.2~1.4.2
2.2.7.RELEASE1.8.12.0.34.6.12.7.131.3.0
2.2.6.RELEASE1.8.11.4.24.4.02.7.81.3.0

Spring Cloud 架构版本关系

由于 Spring Boot 3.0,Spring Boot 2.7~2.4 和 2.4 以下版本之间变化较大,为了同时满足不同版本用户的需求,社区以 Spring Boot 3.0 和 2.4 分别为分界线,同时维护 2022.x、2021.x、2.2.x 三个分支迭代。

说明

如果需要使用新特性且不跨分支升级,那么需要升级为对应分支的新版本。

Spring Cloud Alibaba VersionSpring Cloud VersionSpring Boot Version
2022.0.0.0-RC*Spring Cloud 2022.0.03.0.0
2021.0.4.0*Spring Cloud 2021.0.42.6.11
2021.0.1.0Spring Cloud 2021.0.12.6.3
2021.1Spring Cloud 2020.0.12.4.2
2.2.10-RC1*Spring Cloud Hoxton.SR122.3.12.RELEASE
2.2.9.RELEASESpring Cloud Hoxton.SR122.3.12.RELEASE
2.2.8.RELEASESpring Cloud Hoxton.SR122.3.12.RELEASE
2.2.7.RELEASESpring Cloud Hoxton.SR122.3.12.RELEASE
2.2.6.RELEASESpring Cloud Hoxton.SR92.3.2.RELEASE
2.2.1.RELEASESpring Cloud Hoxton.SR32.2.5.RELEASE
2.2.0.RELEASESpring Cloud Hoxton.RELEASE2.2.X.RELEASE
2.1.4.RELEASESpring Cloud Greenwich.SR62.1.13.RELEASE
2.1.2.RELEASESpring Cloud Greenwich2.1.X.RELEASE
2.0.4.RELEASE (停止维护,建议升级)Spring Cloud Finchley2.0.X.RELEASE
1.5.1.RELEASE(停止维护,建议升级)Spring Cloud Edgware1.5.X.RELEASE