Fix false parent cycle detection with flatten-maven-plugin by gnodet · Pull Request #11400 · apache/maven (original) (raw)
changed the title
[GH-11399] Fix false parent cycle detection with flatten-maven-plugin Fix false parent cycle detection with flatten-maven-plugin
gnodet changed the base branch from master to maven-4.0.x
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
gnodet added a commit to gnodet/maven that referenced this pull request
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 added a commit that referenced this pull request
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 #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 }})