Let's get started with a Microservice Architecture with Spring Cloud:
Upgrading Spring Framework Version in Spring Boot
Last updated: September 23, 2026
1. Introduction
Spring Boot simplifies Java application development through auto-configuration, dependency management, embedded servers, and production-ready features. It builds on the Spring Framework, which provides features such as dependency injection, Spring MVC, and application configuration. As the Spring Framework evolves, developers may need to adopt newer framework versions to access security improvements, bug fixes, performance enhancements, and compatibility options for newer Java versions. However, upgrading requires more than changing a version number. Spring Boot manages several related dependencies, so developers must maintain compatibility between them.
In this tutorial, we’ll explore how to upgrade the Spring Framework version in a Spring Boot application safely and systematically. First, we’ll examine how Spring Boot manages Spring Framework dependencies and how to identify the versions used by an application. Then, we’ll follow the recommended approach of upgrading Spring Boot to obtain the required Spring Framework version. Also, we’ll use the Maven dependency tree and effective POM to investigate unexpected dependency versions and identify dependency-management conflicts. Finally, we’ll review compatibility requirements, migration changes, and best practices to help maintain application stability after the upgrade.
2. Spring Framework Version Management in Spring Boot
Spring Boot manages dependency versions for each release. This dependency management includes the Spring Framework modules used by the application. Therefore, applications can declare Spring dependencies without specifying their versions individually.
To begin, a Maven project can use the Spring Boot parent:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>YOUR_BOOT_VERSION</version>
<relativePath/>
</parent>
The Spring Boot parent provides access to the Spring Boot dependency management, including the spring-boot-dependencies POM. This POM defines compatible versions for Spring Framework modules and other dependencies.
Therefore, a dependency such as spring-web can be declared without specifying its version explicitly:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
Maven then obtains the version from the Spring Boot dependency management. This approach keeps related Spring Framework modules aligned. It also avoids defining individual versions throughout the application.
The same mechanism applies when Spring Framework modules are included through a Spring Boot starter:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
The starter brings in the required Spring dependencies, while Spring Boot supplies their managed versions. As a result, the application uses a consistent set of Spring Framework modules without defining each version manually.
Therefore, upgrading Spring Framework in a Spring Boot application requires understanding this dependency-management relationship. Since Spring Boot manages the framework version for each release, the recommended approach is to upgrade Spring Boot to a release that provides the required Spring Framework version.
3. Checking the Current Spring Framework Version
Before upgrading the Spring Framework, we should first identify the version currently used by the application. The Maven dependency tree can show the versions resolved during the build.
We can check them with the dependency:tree subcommand of mvn:
mvn dependency:tree -Dincludes=org.springframework
The output may contain several entries:
org.springframework:spring-core:jar:5.2.8.RELEASE
org.springframework:spring-web:jar:5.2.8.RELEASE
Each entry identifies a Spring Framework module and the version Maven resolves for it. However, the version shown in the dependency tree may not come directly from the project pom.xml. Spring Boot can provide the version through its dependency management. Other imported BOMs or dependency-management configurations can also affect the final resolved version.
Therefore, checking the dependency tree gives us a clear starting point. Once we identify the current version, we can determine which Spring Boot release provides the required newer version. The next section explains this upgrade process.
4. Upgrading the Current Spring Framework Version
Once we know the current Spring Framework version and how it’s managed, the next step is to select a Spring Boot release that manages the required version.
Spring Boot manages a compatible set of dependency versions for each release. Therefore, moving to a newer Boot release updates the managed Spring Framework version along with its related dependencies.
4.1. Upgrade the Spring Boot Version
To upgrade Spring Boot, we only need to change the Boot version declared in the parent POM:
<version>NEW_BOOT_VERSION</version>
After this change, Maven uses the dependency-management configuration associated with the new Spring Boot release. Consequently, the application receives the Spring Framework version managed by that release. We don’t need to specify versions for individual Spring Framework modules because Spring Boot continues to manage them.
4.2. Verify the Resolved Version
After completing the upgrade, run the dependency tree again. Check the Spring Framework modules and their resolved versions. They should correspond to the dependency versions managed by the selected Spring Boot release.
This verification is important because changing the Boot version doesn’t guarantee that every dependency configuration in a complex project behaves as expected. Imported BOMs or internal libraries can influence the resolved version. If Maven resolves an unexpected Spring Framework version, we should inspect the effective project POM and dependency tree.
To that end, we continue with an explanation of how to trace such dependency-management issues.
5. Investigating Unexpected Dependency Versions
After upgrading Spring Boot, Maven should resolve the Spring Framework version managed by the selected Boot release. Complex projects can contain additional dependency-management configurations that affect the final resolved version. For example, the application may import another BOM or define its own dependency-management entries that override versions managed by Spring Boot. Dependencies may also introduce transitive Spring modules, which can influence dependency resolution.
The effective POM helps trace the source of an unexpected dependency version as it combines the inherited and imported dependency configuration.
Let’s begin by generating it:
mvn help:effective-pom
Then, we search for entries:
spring-boot-dependencies
spring-framework-bom
By examining the effective POM together with the dependency tree, we can determine which dependency-management configuration controls the resolved Spring Framework version and investigate possible overrides or conflicts.
6. Verifying the Upgrade
Upgrading Spring Boot changes the managed Spring Framework version and may affect application behavior. Therefore, the upgrade should be validated beyond dependency resolution.
6.1. Review Migration Changes
Newer Spring Framework releases may introduce API changes, deprecate existing features, or remove APIs that were previously available. Configuration behavior can also change between framework versions. Therefore, we should review the relevant migration documentation and update application code or configuration where necessary.
6.2. Third-Party Dependencies
The application may also depend on libraries that integrate with Spring Framework. These libraries may have their own compatibility requirements. After upgrading, we should test components such as security, database access, web endpoints, and other Spring-based integrations to ensure that they support the upgraded environment.
7. Best Practices
When upgrading the Spring Framework in a Spring Boot application, we should follow a few practices to keep the upgrade manageable and maintainable:
- Prefer upgrading Spring Boot: We should choose a Spring Boot release that manages the required Spring Framework version. This keeps related dependencies aligned.
- Avoid unnecessary overrides: We shouldn’t manually specify a Spring Framework version when the selected Spring Boot release already provides the required version.
- Keep Spring Framework modules aligned: We shouldn’t specify different versions for individual Spring Framework modules, as this can introduce compatibility problems.
By sticking to the suggestions above, we can mitigate many of the issues that still persist despite the automatic dependency management.
8. Conclusion
In this article, we explored how Spring Boot manages Spring Framework versions through its dependency-management system. Since Spring Boot provides compatible versions of Spring Framework modules, upgrading the Framework usually starts with selecting a Spring Boot release that manages the required version. This approach keeps the Framework modules aligned and avoids unnecessary dependency overrides.
Also, we used Maven to check the resolved Framework version and investigate unexpected dependency versions through the effective POM and dependency tree. Finally, we reviewed release changes, third-party dependencies, and application behavior after the upgrade. Together, these steps provide a structured way to upgrade the Spring Framework while keeping dependency resolution consistent and the application compatible.
















