Skip to content

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

Merged
gnodet merged 2 commits into
masterfrom
fix-12080-comment-undefined-property-deps
May 26, 2026
Merged

Fix #12080: mvnup - comment out dependencies with undefined property expressions#12083
gnodet merged 2 commits into
masterfrom
fix-12080-comment-undefined-property-deps

Conversation

@gnodet

@gnodet gnodet commented May 18, 2026

Copy link
Copy Markdown
Contributor

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

gnodet and others added 2 commits May 26, 2026 16:11
Move Maven session management (getSession, createMaven4Session,
TransporterFactoryConfig, temp directory helpers, buildEffectiveModel)
from PluginUpgradeStrategy into AbstractUpgradeStrategy to enable
reuse across strategies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…expressions

Comment out dependencies whose version uses a property expression that
is not defined in any POM in the reactor. Scans <properties> sections
including those in profiles. Well-known properties (project.*, env.*,
maven.*, etc.) are excluded from the check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet
gnodet force-pushed the fix-12080-comment-undefined-property-deps branch from 6878cea to da17364 Compare May 26, 2026 14:11
@gnodet
gnodet merged commit 5583525 into master May 26, 2026
42 of 43 checks passed
@gnodet
gnodet deleted the fix-12080-comment-undefined-property-deps branch May 26, 2026 20:28
@github-actions github-actions Bot added this to the 4.1.0 milestone May 26, 2026
@github-actions

Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

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