bigywater.tech
Spring · 116

版本矩阵:Spring Cloud、Boot 与 Alibaba 的对应关系

Spring Cloud、Spring Boot、Spring Cloud Alibaba 的版本到底怎么对应?配错了会发生什么?关掉兼容性校验器能不能蒙混过关?这篇从 Maven Central 的 pom 里读出对应关系,并真正起 4 组 Boot 与 Cloud 的组合看结果。

4.0.8
Cloud 2025.1.3 构建时对应的 Spring Boot 版本
NoClassDefFoundError
Boot 3.5 配 Cloud 2025.1,或 Boot 4 配 Cloud 2025.0 的启动错误
3.1.1
Alibaba 2025.1.0.0 的 nacos-client 版本

发布列车与 Boot

实测 · 本机执行输出
  2023.0.6:spring-cloud-build 4.1.6 里的 spring-boot.version = 3.3.13;commons 4.1.6;gateway 4.1.9;openfeign 4.1.5;config 4.1.7;circuitbreaker 3.1.5;stream 4.1.6;kubernetes 3.1.6
  2024.0.3:spring-cloud-build 4.2.4 里的 spring-boot.version = 3.4.12;commons 4.2.4;gateway 4.2.7;openfeign 4.2.3;config 4.2.4;circuitbreaker 3.2.3;stream 4.2.3;kubernetes 3.2.3
  2025.0.3:spring-cloud-build 4.3.4 里的 spring-boot.version = 3.5.15;commons 4.3.3;gateway 4.3.5;openfeign 4.3.3;config 4.3.4;circuitbreaker 3.3.3;stream 4.3.3;kubernetes 3.3.3
  2025.1.3:spring-cloud-build 5.0.3 里的 spring-boot.version = 4.0.8;commons 5.0.3;gateway 5.0.3;openfeign 5.0.3;config 5.0.5;circuitbreaker 5.0.3;stream 5.0.3;kubernetes 5.0.3

2023.0→Boot 3.3,2024.0→3.4,2025.0→3.5,2025.1→4.0;各组件版本号各不相同。

错配的结果

实测 · 本机执行输出
  Boot 4.0.8 + Cloud 2025.1.3 → 启动成功:Boot 4.0.8,Spring Framework 7.0.9
  Boot 3.5.16 + Cloud 2025.1.3 → 启动失败(退出码 1):Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/bootstrap/ConfigurableBootstrapContext | Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bootstrap.ConfigurableBootstrapContext
  Boot 4.0.8 + Cloud 2025.0.3 → 启动失败(退出码 1):Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/web/context/WebServerInitializedEvent | Caused by: java.lang.ClassNotFoundException: org.springframework.boot.web.context.WebServerInitializedEvent
  Boot 3.5.16 + Cloud 2025.0.3 → 启动成功:Boot 3.5.16,Spring Framework 6.2.19
  Boot 3.5.16 + Cloud 2025.1.3,加 -Dspring.cloud.compatibility-verifier.enabled=false → 启动失败(退出码 1):Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/bootstrap/ConfigurableBootstrapContext | Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bootstrap.ConfigurableBootstrapContext

大版本错配直接 NoClassDefFoundError,关闭兼容性校验器无效。

Spring Cloud Alibaba

实测 · 本机执行输出
  Alibaba 2023.0.3.4:nacos-client 2.4.3;sentinel 1.8.8;seata 2.1.0;parent spring-cloud-dependencies-parent 4.1.0
  Alibaba 2025.0.0.0:nacos-client 3.0.3;sentinel 1.8.9;seata 2.5.0;parent spring-cloud-dependencies-parent 4.3.0
  Alibaba 2025.1.0.0:nacos-client 3.1.1;sentinel 1.8.9;seata 2.5.0;parent spring-cloud-dependencies-parent 5.0.0
  Boot 4.0.8 + Cloud 2025.1.3 + Alibaba 2025.1.0.0 的 nacos-discovery(关闭注册与发现,不连 Nacos)→ 启动成功:Boot 4.0.8,Spring Framework 7.0.9

四段版本号,前两段对应 Cloud 列车;nacos-client 随列车升到 3.x。

分步演示

版本矩阵
本步的对象

    本文用到的工具与边界

    • 本机 macOS 27 arm64 / OpenJDK 21.0.12(Homebrew) / Spring Boot 4.0.8(Spring Framework 7.0.9、Tomcat 11.0.24) / Spring Cloud 2025.1.3;用 javac 编译、java 直接运行,依赖由 Maven 从 Maven Central 解析;数字每次运行会有小幅抖动(版本对应关系从 Maven Central 的 spring-cloud-dependencies、spring-cloud-build、spring-cloud-alibaba-dependencies 的 pom 读出;配对实验另外用到 Boot 3.5.16 与 Cloud 2025.0.3;每组只引入 spring-cloud-starter 并启动一个非 Web 程序)
    • 没有验证:Alibaba 版本号后两段的含义(文档里怎么定义的没有核对);我这里的错配启动失败是 NoClassDefFoundError,没有看到 Spring Cloud 的 compatibility verifier 打出的「不兼容」提示,它在什么情况下才会出现,没有验证;Boot 3.4 配 Cloud 2025.0 这样的小版本错位;spring-cloud-starter-alibaba-nacos-discovery 与真实 Nacos 服务端的交互;其他 Alibaba 组件(sentinel、seata、rocketmq)在 Boot 4 上的启动;2026.0 里程碑版本
    京ICP备2026067502号-1京公网安备11010502063487号