ReactorReader: prefer consumer POM from project-local repo when resolving POMs#11084
Closed
ReactorReader: prefer consumer POM from project-local repo when resolving POMs#11084
Conversation
gnodet
added a commit
that referenced
this pull request
Sep 1, 2025
…l repo using consumer POM if present New IT builds module 'a' first to populate project-local repo, then builds only 'b' which depends on 'a'. The antrun assertion ensures the consumer POM exists, and the behavior is verified by successful resolution.
gnodet
added a commit
that referenced
this pull request
Sep 1, 2025
77298cc to
b451d75
Compare
…ving POMs When only part of a reactor is built, ReactorReader mirrors artifacts into a project-local repo. If a module depends on another reactor module not in the current session, POM resolution may hit that repo. Today, the main POM path contains the build POM, which can include Maven-4 build-time constructs and be invalid as a repository POM (e.g., missing parent.*). As a result, dependency resolution can fail with fatal model errors. Teach ReactorReader to prefer the consumer POM (classifier=consumer) for POM artifacts when present in the project-local repo, falling back to the main POM otherwise. This avoids consuming a build POM from the project-local repo without changing the repo contents or layout.
b451d75 to
576d21a
Compare
When building modules in isolation (outside of the full reactor), the ReactorReader should prefer consumer POMs from the project-local repository over build POMs to avoid invalid POM elements like <parent />. The findModel method now: 1. First checks if the project is in the current reactor session 2. If not found, looks for a consumer POM in the project-local repository 3. Uses the same consumer POM preference logic as findInProjectLocalRepository This eliminates 'invalid POM' warnings when building modules in isolation while maintaining backward compatibility for reactor builds. Fixes gh-11084
gnodet
added a commit
that referenced
this pull request
Sep 17, 2025
* ReactorReader: prefer consumer POM from project-local repo when resolving POMs When only part of a reactor is built, ReactorReader mirrors artifacts into a project-local repo. If a module depends on another reactor module not in the current session, POM resolution may hit that repo. Today, the main POM path contains the build POM, which can include Maven-4 build-time constructs and be invalid as a repository POM (e.g., missing parent.*). As a result, dependency resolution can fail with fatal model errors. Teach ReactorReader to prefer the consumer POM (classifier=consumer) for POM artifacts when present in the project-local repo, falling back to the main POM otherwise. This avoids consuming a build POM from the project-local repo without changing the repo contents or layout. * Fix ReactorReader to prefer consumer POMs over build POMs When building modules in isolation (outside of the full reactor), the ReactorReader should prefer consumer POMs from the project-local repository over build POMs to avoid invalid POM elements like <parent />. The findModel method now: 1. First checks if the project is in the current reactor session 2. If not found, looks for a consumer POM in the project-local repository 3. Uses the same consumer POM preference logic as findInProjectLocalRepository This eliminates 'invalid POM' warnings when building modules in isolation while maintaining backward compatibility for reactor builds. Fixes gh-11084 * Fix
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
Sep 17, 2025
* ReactorReader: prefer consumer POM from project-local repo when resolving POMs When only part of a reactor is built, ReactorReader mirrors artifacts into a project-local repo. If a module depends on another reactor module not in the current session, POM resolution may hit that repo. Today, the main POM path contains the build POM, which can include Maven-4 build-time constructs and be invalid as a repository POM (e.g., missing parent.*). As a result, dependency resolution can fail with fatal model errors. Teach ReactorReader to prefer the consumer POM (classifier=consumer) for POM artifacts when present in the project-local repo, falling back to the main POM otherwise. This avoids consuming a build POM from the project-local repo without changing the repo contents or layout. * Fix ReactorReader to prefer consumer POMs over build POMs When building modules in isolation (outside of the full reactor), the ReactorReader should prefer consumer POMs from the project-local repository over build POMs to avoid invalid POM elements like <parent />. The findModel method now: 1. First checks if the project is in the current reactor session 2. If not found, looks for a consumer POM in the project-local repository 3. Uses the same consumer POM preference logic as findInProjectLocalRepository This eliminates 'invalid POM' warnings when building modules in isolation while maintaining backward compatibility for reactor builds. Fixes apachegh-11084 * Fix (cherry picked from commit 93b85b0)
gnodet
added a commit
that referenced
this pull request
Sep 17, 2025
…11131) ReactorReader: prefer consumer POMs over build POMs for isolated module builds When building modules in isolation (outside of the full reactor), ReactorReader now prefers consumer POMs from the project-local repository over build POMs. This prevents dependency resolution failures caused by build POMs containing Maven-4 build-time constructs that are invalid as repository POMs (e.g., missing parent elements). The findModel method now: 1. First checks if the project is in the current reactor session 2. If not found, looks for a consumer POM in the project-local repository 3. Uses the same consumer POM preference logic as findInProjectLocalRepository This eliminates 'invalid POM' warnings when building modules in isolation while maintaining backward compatibility for reactor builds without changing repository contents or layout. Fixes gh-11084
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When only part of a reactor is built, ReactorReader mirrors artifacts into a project-local repo. If a module depends on another reactor module not in the current session, POM resolution may hit that repo. Today, the main POM path contains the build POM, which can include Maven-4 build-time constructs and be invalid as a repository POM (e.g., missing parent.*). As a result, dependency resolution can fail with fatal model errors.
Teach ReactorReader to prefer the consumer POM (classifier=consumer) for POM artifacts when present in the project-local repo, falling back to the main POM otherwise. This avoids consuming a build POM from the project-local repo without changing the repo contents or layout.