Resolve classified POM artifacts from the reactor [4.x] - #12658
Conversation
gnodet
left a comment
There was a problem hiding this comment.
Clean, minimal fix that correctly limits the ReactorReader build-POM shortcut to unclassified POM requests. Classified POMs now correctly fall through to the attached-artifact matching path.
The fix is consistent with the existing classifier-aware logic already present in findInProjectLocalRepository (lines 336-337), which similarly restricts the consumer-POM lookup to unclassified POM requests.
The integration test adequately covers the regression scenario (producer attaches a classified POM, consumer resolves it from the reactor).
Minor observation: the test class name uses mdep0590 prefix (from the Maven Dependency Plugin JIRA tracker), while Maven core integration tests typically use mng or gh prefixes. Not a blocker.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code on behalf of gnodet
Following this checklist to help us incorporate your
contribution quickly and easily:
Note that commits might be squashed by a maintainer on merge.
This may not always be possible but is a best-practice.
mvn verifyto make sure basic checks pass.A more thorough check will be performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
Description
ReactorReadercurrently returns the reactor project's build POM for every artifact whose extension ispom, without considering its classifier. Consequently, resolving an attached classified POM from the reactor returnspom.xmlinstead of the attached artifact.This change limits the build-POM shortcut to unclassified POM requests. Classified POMs proceed through the existing artifact matching path, which selects the attached artifact by extension and classifier. Ordinary reactor POM and consumer-POM resolution remain unchanged.
Fixes apache/maven-dependency-plugin#1024
Tests
mvn verify: all 38 modules passed with RAT enabled (2:01).maven-core, with no failures.MavenITmdep0590ClassifiedPomArtifactFromReactorTestMavenITmng8293BomImportFromReactorMavenITgh11084ReactorReaderPreferConsumerPomTest