Skip to content

Fix flyway starter getting explicit version when managed by parent#994

Merged
timtebeek merged 3 commits intomainfrom
tim/flyway-version-bug
Apr 9, 2026
Merged

Fix flyway starter getting explicit version when managed by parent#994
timtebeek merged 3 commits intomainfrom
tim/flyway-version-bug

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented Apr 9, 2026

Summary

  • Move MigrateToModularStarters after UpgradeParentVersion in UpgradeSpringBoot_4_0 recipe ordering

  • When MigrateToModularStarters ran before the parent upgrade, AddDependency added spring-boot-starter-flyway with an explicit <version>4.0.5</version> because the parent was still 3.5.x (which doesn't manage that artifact). After the parent is upgraded to 4.0.x, the version is managed and should be omitted.

  • Add reproducer test: multi-module project with ${revision}, spring-boot-starter-parent:3.5.13, and flyway-database-postgresql in a child module

  • Fixes ChangeParentPom incorrectly updates child module after update rewrite#7307

Test plan

  • New test UpgradeSpringBoot_4_0Test.flywayStarterOmitsVersionWhenManagedByParent fails before fix, passes after
  • Existing MigrateToModularStartersTest (7 tests) passes
  • Existing RenameDeprecatedStartersManagedVersionsTest (2 tests) passes

MigrateToModularStarters ran before UpgradeParentVersion, so when
AddDependency added spring-boot-starter-flyway the parent was still
3.5.x (which doesn't manage that artifact). Move it after the
parent/BOM upgrades so the managed version is visible.

Fixes openrewrite/rewrite#7307
@timtebeek timtebeek merged commit 25c689f into main Apr 9, 2026
1 check passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Apr 9, 2026
@timtebeek timtebeek deleted the tim/flyway-version-bug branch April 9, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ChangeParentPom incorrectly updates child module after update

1 participant