Skip to content

[#12303] Fix CI-friendly ${revision} not interpolated for non-build POM reads#12322

Open
gnodet wants to merge 1 commit into
apache:maven-4.0.xfrom
gnodet:fix-12303
Open

[#12303] Fix CI-friendly ${revision} not interpolated for non-build POM reads#12322
gnodet wants to merge 1 commit into
apache:maven-4.0.xfrom
gnodet:fix-12303

Conversation

@gnodet

@gnodet gnodet commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the ${revision} CI-friendly version placeholder not being interpolated when Maven reads dependency or parent POMs outside of a build request (e.g. when the maven-remote-resources-plugin resolves the project's own POM).

  • In DefaultModelBuilder.doReadFileModel(), the CI-friendly version interpolation for non-build requests was guarded by else if (modelSource.getPath() != null). Since ResolvedPathSource.getPath() always returns null, the replaceCiFriendlyVersion() call was dead code.
  • Changed to an unconditional else block so getEnhancedProperties() and replaceCiFriendlyVersion() always run for non-build requests.
  • Added IT that exercises the fix with a dependency whose parent POM uses ${revision} in its version.

Verified against the original use case (bigtop-manager project from #12303): without the fix, process-resources fails with Invalid Version Range Request: ...pom:${revision}; with the fix, the version resolves correctly to 1.2.0-SNAPSHOT.

Fixes #12303

Test plan

Claude Code on behalf of Guillaume Nodet

@gnodet gnodet force-pushed the fix-12303 branch 2 times, most recently from c846987 to 882e183 Compare June 19, 2026 09:18
@gnodet gnodet marked this pull request as ready for review June 19, 2026 09:57
@gnodet gnodet changed the title [#12303] Fix CI-friendly ${revision} not interpolated for dependency POMs [#12303] Fix CI-friendly ${revision} not interpolated for non-build POM reads Jun 19, 2026
@gnodet gnodet requested review from cstamas and hboutemy June 19, 2026 09:59
…dency POMs

In DefaultModelBuilder.doReadFileModel(), the CI-friendly version
interpolation for non-build requests (dependency/parent POM reads)
was guarded by `else if (modelSource.getPath() != null)`.
Since ResolvedPathSource.getPath() always returns null for
repository-resolved POMs, the ${revision} replacement never executed.

Changed to unconditional else so getEnhancedProperties() and
replaceCiFriendlyVersion() always run for non-build requests.
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