Skip to content

[maven-4.0.x] Fix mvnup to replace deprecated ${basedir} in repository URLs#12106

Merged
gnodet merged 1 commit into
maven-4.0.xfrom
backport/maven-4.0.x/pr-12105
May 20, 2026
Merged

[maven-4.0.x] Fix mvnup to replace deprecated ${basedir} in repository URLs#12106
gnodet merged 1 commit into
maven-4.0.xfrom
backport/maven-4.0.x/pr-12105

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented May 19, 2026

Summary

Backport of #12105 to maven-4.0.x.

  • Fix CompatibilityFixStrategy.fixRepositoryExpressions() to 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
  • 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

…y URLs (#12105)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gnodet gnodet force-pushed the backport/maven-4.0.x/pr-12105 branch from b57809c to e349e9f Compare May 19, 2026 20:04
@gnodet gnodet merged commit d39e57d into maven-4.0.x May 20, 2026
23 checks passed
@gnodet gnodet deleted the backport/maven-4.0.x/pr-12105 branch May 20, 2026 14:31
@github-actions github-actions Bot added this to the 4.0.0-rc-6 milestone May 20, 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.

1 participant