eBook – Guide Spring Cloud – NPI EA (cat=Spring Cloud)
announcement - icon

Let's get started with a Microservice Architecture with Spring Cloud:

>> Join Pro and download the eBook

eBook – Mockito – NPI EA (tag = Mockito)
announcement - icon

Mocking is an essential part of unit testing, and the Mockito library makes it easy to write clean and intuitive unit tests for your Java code.

Get started with mocking and improve your application tests using our Mockito guide:

Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Reactive – NPI EA (cat=Reactive)
announcement - icon

Spring 5 added support for reactive programming with the Spring WebFlux module, which has been improved upon ever since. Get started with the Reactor project basics and reactive programming in Spring Boot:

>> Join Pro and download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Jackson – NPI EA (cat=Jackson)
announcement - icon

Do JSON right with Jackson

Download the E-book

eBook – HTTP Client – NPI EA (cat=Http Client-Side)
announcement - icon

Get the most out of the Apache HTTP Client

Download the E-book

eBook – Maven – NPI EA (cat = Maven)
announcement - icon

Get Started with Apache Maven:

Download the E-book

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

eBook – RwS – NPI EA (cat=Spring MVC)
announcement - icon

Building a REST API with Spring?

Download the E-book

Course – LS – NPI EA (cat=Jackson)
announcement - icon

Get started with Spring and Spring Boot, through the Learn Spring course:

>> LEARN SPRING
Course – RWSB – NPI EA (cat=REST)
announcement - icon

Explore Spring Boot 3 and Spring 6 in-depth through building a full REST API with the framework:

>> The New “REST With Spring Boot”

Course – LSS – NPI EA (cat=Spring Security)
announcement - icon

Yes, Spring Security can be complex, from the more advanced functionality within the Core to the deep OAuth support in the framework.

I built the security material as two full courses - Core and OAuth, to get practical with these more complex scenarios. We explore when and how to use each feature and code through it on the backing project.

You can explore the course here:

>> Learn Spring Security

Course – All Access – NPI EA (cat= Spring)
announcement - icon

All Access is finally out, with all of my Spring courses. Learn JUnit is out as well, and Learn Maven is coming fast. And, of course, quite a bit more affordable. Finally.

>> GET THE COURSE
Course – LSD – NPI EA (tag=Spring Data JPA)
announcement - icon

Spring Data JPA is a great way to handle the complexity of JPA with the powerful simplicity of Spring Boot.

Get started with Spring Data JPA through the guided reference course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (cat=Spring Boot)
announcement - icon

Refactor Java code safely — and automatically — with OpenRewrite.

Refactoring big codebases by hand is slow, risky, and easy to put off. That’s where OpenRewrite comes in. The open-source framework for large-scale, automated code transformations helps teams modernize safely and consistently.

Each month, the creators and maintainers of OpenRewrite at Moderne run live, hands-on training sessions — one for newcomers and one for experienced users. You’ll see how recipes work, how to apply them across projects, and how to modernize code with confidence.

Join the next session, bring your questions, and learn how to automate the kind of work that usually eats your sprint time.

Course – LJB – NPI EA (cat = Core Java)
announcement - icon

Code your way through and build up a solid, practical foundation of Java:

>> Learn Java Basics

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.

Baeldung Pro – NPI EA (cat = Baeldung)
announcement - icon

Baeldung Pro comes with both absolutely No-Ads as well as finally with Dark Mode, for a clean learning experience:

>> Explore a clean Baeldung

eBook – HTTP Client – NPI EA (cat=HTTP Client-Side)
announcement - icon

The Apache HTTP Client is a very robust library, suitable for both simple and advanced use cases when testing HTTP endpoints. Check out our guide covering basic request and response handling, as well as security, cookies, timeouts, and more:

>> Download the eBook

eBook – Java Concurrency – NPI EA (cat=Java Concurrency)
announcement - icon

Handling concurrency in an application can be a tricky process with many potential pitfalls. A solid grasp of the fundamentals will go a long way to help minimize these issues.

Get started with understanding multi-threaded applications with our Java Concurrency guide:

>> Download the eBook

eBook – Java Streams – NPI EA (cat=Java Streams)
announcement - icon

Since its introduction in Java 8, the Stream API has become a staple of Java development. The basic operations like iterating, filtering, mapping sequences of elements are deceptively simple to use.

But these can also be overused and fall into some common pitfalls.

To get a better understanding on how Streams work and how to combine them with other language features, check out our guide to Java Streams:

>> Join Pro and download the eBook

eBook – Persistence – NPI EA (cat=Persistence)
announcement - icon

Working on getting your persistence layer right with Spring?

Explore the eBook

Course – LS – NPI EA (cat=REST)

announcement - icon

Get started with Spring Boot and with core Spring, through the Learn Spring course:

>> CHECK OUT THE COURSE

Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

eBook Jackson – NPI EA – 3 (cat = Jackson)
guest
0 Comments
Oldest
Newest