Skip to content

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Nov 6, 2025

Backport

This will backport the following commits from maven-4.0.x to master:

Questions ?

Please refer to the Backport tool documentation

…che#11399) (apache#11400)

When using flatten-maven-plugin with updatePomFile=true and parent expansion,
Maven incorrectly detected a parent cycle during the install phase. The error
occurred because the consumer POM builder was using Path instead of ModelSource
when reading the flattened POM.

This change updates the PomArtifactTransformer API to use ModelSource instead
of Path. ModelSource includes the necessary context (base directory, ModelLocator)
to properly resolve parent POMs and avoid false cycle detection.

Changes:
- Updated PomArtifactTransformer.transform() to accept ModelSource instead of Path
- Modified ConsumerPomArtifactTransformer to create ModelSource with proper resolution context
- Updated DefaultConsumerPomBuilder and related classes to work with ModelSource
- Added integration test to verify the fix

Fixes apache#11399

(cherry picked from commit 5ec059c)

# Conflicts:
#	impl/maven-core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomArtifactTransformerTest.java
@gnodet gnodet merged commit 83a3863 into apache:master Nov 6, 2025
22 checks passed
@github-actions github-actions bot added this to the 4.1.0 milestone Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant