Repository navigation
Nacos 与 Springboot-3.5 的版本兼容性问题 #15912
|
我的模块只使用了 Springboot-3.5, 而且未使用 SpringCloud , 现在想找一个能完美适配 Springboot-3.5 的 Nacos 客户端作为启动配置加载处理, 将 Springboot 启动配置加载进来. 我尝试了 spring-alibaba-nacos-config / spring-cloud-starter-alibaba-nacos-config 的 2025 版本 ,但是好像版本都不匹配,启动时报错。 请问 Nacos 的哪个客户端模块可以完整兼容 Springboot-3.5 版本来实现我的目标呢? |
Replies: 2 comments 3 replies
|
use spring-cloud-starter-alibaba-nacos-config : 2025 , fire error: |
|
The stack trace tells you which version you picked up. For Boot 3.5 you want 2025.0.0.0, which pins Boot 3.5.0 (pom.xml#L89). The branch mapping is in the README: 2025.1.x → Boot 4.0.x, 2025.0.x → Boot 3.5.x. <dependencyManagement>
<dependencies>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
<version>2025.0.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>You don't need Spring Cloud anywhere else in the project. The starter pulls I tried both against Boot 3.5.16 (JDK 17, Nacos server 3.0.3 standalone): with 2025.1.0.0 I get your exact The old |
The stack trace tells you which version you picked up.
org.springframework.boot.bootstrap.ConfigurableBootstrapContextis the Spring Boot 4 package; in Boot 3.5 that class lives inorg.springframework.boot(3.5.0 vs 4.0.0). So the artifact you have was compiled against Boot 4, which means Spring Cloud Alibaba 2025.1.0.0 (pom.xml#L89 pins Boot 4.0.0). The line numbers in your trace (112 / 83 / 149) match that tag exactly.For Boot 3.5 you want 2025.0.0.0, which pins Boot 3.5.0 (pom.xml#L89). The branch mapping is in the README: 2025.1.x → Boot 4.0.x, 2025.0.x → Boot 3.5.x.