Skip to content

Fix #12080: mvnup - comment out dependencies with undefined property expressions#12083

Open
gnodet wants to merge 1 commit into
masterfrom
fix-12080-comment-undefined-property-deps
Open

Fix #12080: mvnup - comment out dependencies with undefined property expressions#12083
gnodet wants to merge 1 commit into
masterfrom
fix-12080-comment-undefined-property-deps

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 18, 2026

Summary

  • Add a new compatibility fix to CompatibilityFixStrategy that comments out dependencies with undefined property expressions in their coordinates (groupId, artifactId, version)
  • Collects all properties from <properties> sections across the reactor (including profiles), skips well-known built-ins (project.*, env.*, settings.*, maven.*, revision, sha1, changelist, etc.)
  • Uses domtrip's Editor.commentOutElement() with a <!-- mvnup: commented out - undefined property '...' --> marker for easy identification and reversal

Fixes #12080

Test plan

  • Unit test: dependency with undefined property gets commented out
  • Unit test: dependency with defined property is preserved
  • Unit test: dependency with well-known built-in property (${project.version}) is preserved
  • Unit test: cross-module property resolution (property defined in parent POM recognized in child)
  • All 13 CompatibilityFixStrategyTest tests pass
  • Formatter produces no changes

🤖 Generated with Claude Code

Claude Code on behalf of Guillaume Nodet

…expressions

Add a new compatibility fix to CompatibilityFixStrategy that detects
dependencies whose coordinate fields (groupId, artifactId, version)
contain ${...} expressions referencing properties not defined in any
project POM. These orphan dependencies cause Maven 4's validator to
reject them with "Not fully interpolated dependency" errors.

The fix collects all properties from <properties> sections across the
reactor (including profiles), skips well-known built-in properties
(project.*, env.*, settings.*, maven.*, revision, sha1, changelist,
etc.), and comments out dependencies with truly undefined expressions
using <!-- mvnup: commented out - undefined property '...' --> format.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the fix-12080-comment-undefined-property-deps branch from b7e2f64 to d85775a Compare May 20, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mvnup: comment out dependencies with unresolved property expressions

1 participant