Repository navigation
Upgrade imported Spring Boot 3 BOMs in UpgradeToJava25 - #1402
Open
bryanfriedman wants to merge 1 commit into
Open
bryanfriedman wants to merge 1 commit into
bryanfriedman wants to merge 1 commit into
Conversation
Projects that import spring-boot-dependencies or spring-boot-starter-parent with scope import, rather than inheriting from the parent, were left on their old Boot release by UpgradeToJava25. Boot's managed Lombok, Byte Buddy and Mockito then stay too old for Java 25, and a spring-boot-maven-plugin sharing the BOM's version property fails to repackage Java 25 classes. Add UpgradeSpringBootBomForJava25, the BOM counterpart of UpgradeSpringBootParentForJava25: it moves an imported Boot 3.x BOM to the latest 3.5 release and leaves Boot 2 and Boot 4 alone. Seen on techa03/goodsKill, which imports spring-boot-starter-parent 3.3.3 through a springboot.version property.
timtebeek
reviewed
Nov 2, 2026
Comment on lines
+474
to
+475
| artifactId: spring-boot-* | ||
| version: 3.x |
Member
There was a problem hiding this comment.
Should we limit this to just 3.5.x ? Because there's often required changes going between two or more minor versions.
Suggested change
| artifactId: spring-boot-* | |
| version: 3.x | |
| artifactId: spring-boot-* | |
| version: 3.5.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changed
Adds
org.openrewrite.java.migrate.UpgradeSpringBootBomForJava25and includes it inUpgradePluginsForJava25(so inUpgradeToJava25), right afterUpgradeSpringBootParentForJava25.It is the BOM counterpart of the parent recipe. When a Maven project imports
spring-boot-dependenciesorspring-boot-starter-parent3.x with<scope>import</scope>instead of inheriting from it, the imported BOM is moved to the latest 3.5 release. Boot 2 and Boot 4 BOMs are left alone, same as the parent recipe.Why
On a project that imports Boot as a BOM,
UpgradeToJava25leaves Boot on its old release. That causes three problems:UpgradeDependencyVersionsteps for Byte Buddy and Mockito don't override managed versions.spring-boot-maven-pluginusually shares the BOM's version property, and at 3.3.x it failsrepackagewith "Unsupported class file major version 69".UpgradePluginVersionskips it because the property is shared.Moving the BOM to 3.5.x fixes all three through the one version property.
This was found on
techa03/goodsKillduring a Moderne self-paced eval run. That repo importsspring-boot-starter-parent3.3.3 through${springboot.version}. Reproducing the build there took about ten minutes of hand fixes afterUpgradeToJava25.Testing
UpgradeSpringBootBomForJava25Testcovers both imported BOM artifacts through a version property, inclusion inUpgradeToJava25, and no change for Boot 2.7 and 4.0.rewrite-*8.93.11 isn't on Maven Central. Please rely on CI for the test run.techa03/goodsKill. It changed<springboot.version>3.3.3</springboot.version>to3.5.16and nothing else.Not covered
EnableLombokAnnotationProcessorstill skips a root POM that configuresmaven-compiler-pluginbut declares Lombok only in child modules (itsModuleHasDependencyprecondition). On JDK 23+ that leaves annotation processing off. That is a separate fix.