Skip to content

Scanning recipe for upgrading parent blows up#7472

Draft
BoykoAlex wants to merge 3 commits into
openrewrite:mainfrom
BoykoAlex:bug-upgrade-parent-scanning-recipe
Draft

Scanning recipe for upgrading parent blows up#7472
BoykoAlex wants to merge 3 commits into
openrewrite:mainfrom
BoykoAlex:bug-upgrade-parent-scanning-recipe

Conversation

@BoykoAlex
Copy link
Copy Markdown
Contributor

An example of a scanning recipe for upgrading the parent version that just blows up. Unclear how to deal with this. If an an attempt to update the jackson BOM version before the parent version is updated doesn't help. In fact the scanning part of the UpdateParentVersion blows up even if this is the only recipe being executed. Doesn't seem like changing the parent and resolving everything in the scanning phase is a good idea...
@timtebeek @kdvolder

@kdvolder
Copy link
Copy Markdown
Contributor

Just checking in on this PR and the underlying scanning phase limitation. We are currently blocked on migrating some customer projects because we cannot rename properties (like jackson-bom.version) in the same cycle as upgrading the parent POM. Do you have any thoughts on how we might bypass this scanning phase trap or handle these interconnected upgrades?

@timtebeek timtebeek self-requested a review May 26, 2026 19:28
timtebeek added 2 commits May 26, 2026 22:12
The scanner's deep `ResolvedPom.resolve(...)` is brittle: the new parent's
dependencyManagement is interpolated against the current pom's property
map, which can fail when a property was renamed by a prior recipe or when
the user's property value no longer fits the new parent. The failure was
surfaced as a misleading warning marker on `<parent>`, even when the
upgrade itself worked.

Try the deep resolve so descendants can still see the new parent's
managed dependencies. If it throws, fall back to a shallow updated marker
that swaps in the new parent reference; each pom's `maybeUpdateModel`
will re-resolve from the post-edit XML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants