Fix false parent cycle detection with flatten-maven-plugin by gnodet · Pull Request #11400 · apache/maven (original) (raw)

@gnodet changed the title[GH-11399] Fix false parent cycle detection with flatten-maven-plugin Fix false parent cycle detection with flatten-maven-plugin

Nov 6, 2025

@gnodet gnodet changed the base branch from master to maven-4.0.x

November 6, 2025 07:30

@gnodet

…che#11399)

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:

Fixes apache#11399

gnodet added a commit to gnodet/maven that referenced this pull request

Nov 6, 2025

@gnodet

…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:

Fixes apache#11399

(cherry picked from commit 5ec059c)

Conflicts:

impl/maven-core/src/test/java/org/apache/maven/internal/transformation/impl/ConsumerPomArtifactTransformerTest.java

gnodet added a commit that referenced this pull request

Nov 6, 2025

@gnodet

) (#11400) (#11403)

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:

Fixes #11399

(cherry picked from commit 5ec059c)

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})