Skip to content

Fix mvnup to replace deprecated ${basedir} in repository URLs#12105

Merged
gnodet merged 1 commit into
masterfrom
opalescent-rumba
May 20, 2026
Merged

Fix mvnup to replace deprecated ${basedir} in repository URLs#12105
gnodet merged 1 commit into
masterfrom
opalescent-rumba

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 19, 2026

Summary

  • Fix CompatibilityFixStrategy.fixRepositoryExpressions() to actually replace deprecated ${basedir} and ${pom.basedir} with the canonical ${project.basedir} form in repository and pluginRepository URL elements (including inside profiles)
  • Previously the method only logged a warning but never performed the replacement (fixed was never set to true)
  • Add 5 tests covering repositories, pluginRepositories, profiles, and the no-op case

Context

Maven 4 introduced MavenValidator (MNG-8677, PR #2158) which validates that repository URLs are fully interpolated. When a POM uses ${basedir} in a repository URL (e.g. file://${basedir}/internal-repository), this can fail validation since ${basedir} is a deprecated form that may not be interpolated in all contexts (notably during transitive dependency resolution).

The pom. prefix was deprecated in favor of project. (MNG-7244), and prefixless expressions were dropped (MNG-7404).

See: gnodet/maven4-testing#13299

Test plan

  • All existing CompatibilityFixStrategyTest tests pass
  • New tests verify ${basedir}${project.basedir} replacement in repository, pluginRepository, and profile repository URLs
  • New test verifies no modification when URLs already use ${project.basedir} or contain no expressions

Claude Code on behalf of Guillaume Nodet

Maven 4 validates that repository URLs are fully interpolated
(MNG-8677, PR #2158). When a POM uses ${basedir} or ${pom.basedir}
in repository URLs, this can fail validation since these are
deprecated forms that may not be interpolated in all contexts.

The compatibility fix strategy now replaces ${basedir} and
${pom.basedir} with the canonical ${project.basedir} form in
repository and pluginRepository URL elements, including those
inside profiles.

See: gnodet/maven4-testing#13299

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet added a commit that referenced this pull request May 19, 2026
…y URLs (#12105)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet merged commit 66e3222 into master May 20, 2026
24 checks passed
@gnodet gnodet deleted the opalescent-rumba branch May 20, 2026 14:30
gnodet added a commit that referenced this pull request May 20, 2026
…y URLs (#12105) (#12106)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

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

@github-actions github-actions Bot added this to the 4.1.0 milestone May 20, 2026
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.

2 participants