When migrating from Spring Boot 2.3 to Spring Boot 3.5, you need to be aware of compatibility issues, especially with Spring Cloud Sleuth and the related Spring Cloud release train.
Key Points:
- Spring Boot 3.x is based on Spring Framework 6 and Jakarta EE 9+, which involve package namespace changes (
javax.* to jakarta.*).
- Spring Boot 3.x requires Spring Cloud 2022.0.x (codename: Kilburn) or newer, since older Spring Cloud versions do not support Spring Boot 3.x.
- Spring Cloud Sleuth has moved too and in newer Spring Cloud versions, it is largely replaced by Spring Boot's native support for distributed tracing, often through Micrometer Tracing.
- Older versions of Spring Cloud Sleuth (used with Spring Boot 2.x) will not work with Spring Boot 3.x.
What to do?
- Upgrade Spring Cloud Release Train
For Spring Boot 3.5, you should use Spring Cloud 2022.0.x (Kilburn) or later (e.g., 2022.0.2+).
In your pom.xml or build.gradle, change the Spring Cloud BOM:
<!-- Maven example -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>2022.0.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Or in Gradle:
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:2022.0.3"
}
}
- Switch from Spring Cloud Sleuth to Micrometer Tracing
Spring Cloud Sleuth has been deprecated in favor of Micrometer Tracing.
- Remove the
spring-cloud-starter-sleuth dependency.
- Add Micrometer Tracing dependencies if you need tracing capabilities:
For example:
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-brave</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-propagator-brave</artifactId>
</dependency>
and other dependencies depending on your tracing backend (Brave, OpenTelemetry, Zipkin, etc.).
- Change Configuration and Code
- Sleuth annotations and APIs may have changed or no longer apply.
- Review the Micrometer Tracing migration guide and Spring Cloud release notes for changes in configuration properties and usage.
- Check all Transitive Dependencies
Make sure no legacy dependencies pull older versions of Sleuth, or older Spring Cloud versions.
Summary Checklist
If you want, I can help generate a migration example. Let me know!