You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ChangeDependencyGroupIdAndArtifactId updates version properties in parent POMs (#6630)
* `ChangeDependencyGroupIdAndArtifactId` updates version properties in parent POMs
Convert `ChangeDependencyGroupIdAndArtifactId` from `Recipe` to
`ScanningRecipe` so that version properties defined in parent POMs
are updated when the dependency referencing that property is in a
child POM.
The scanner phase identifies version properties inherited from parent
POMs and records which source file defines each property. The visitor
phase then applies property updates when visiting those parent POM
files. All existing visitor logic is preserved unchanged, avoiding
the recipe-chaining issues that caused the previous attempt (#5815)
to be reverted.
Fixesmoderneinc/customer-requests#1374
* Add test for shared property overlap scenario
Verifies that when a property in a parent POM is shared by multiple
dependencies in a child POM, and only one dependency matches the change
criteria, the property is left unchanged and the version is inlined instead.
* Check sibling modules for overlapping property usage
When a version property in a parent POM is shared by dependencies across
different child modules, changing it would break non-matching siblings.
The existing overlap filter only checked the current module's children
and parent dependencies, but not sibling modules.
Walk up the parent chain and check each parent's children to detect
property usage conflicts in sibling modules. When overlap is found,
the version is inlined instead of updating the shared property.
* Add test documenting conservative behavior for redefined child properties
When a child module redefines a parent property used by a non-matching
dependency, the overlap filter conservatively prevents updating the
parent property. This is safe because ChangePropertyValue via doAfterVisit
does not scope to a single document and would also change the child's
intentional override.
* Avoid traversal when newVersion or compartor is null
* Add an early return after handling property tag
---------
Co-authored-by: Tim te Beek <tim@moderne.io>
0 commit comments