You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/03/10 08:24:53 UTC
[PR] [GH-11772] Generate dual consumer POMs for parent POMs with 4.1.0 features [maven]
gnodet opened a new pull request, #11775:
URL: https://github.com/apache/maven/pull/11775
## Summary
When a POM-packaged project (e.g., a parent POM) uses model version 4.1.0 features such as profile condition activation or subprojects, the consumer POM cannot be downgraded to 4.0.0. This breaks Maven 3, Gradle, and any tool that only supports model version 4.0.0.
This PR generates dual consumer POMs for such projects:
- **Main POM** (no classifier): 4.0.0-compatible with 4.1.0 features stripped (condition, packaging activation, build sources, extension configuration)
- **Consumer POM** (`consumer` classifier): 4.1.0 full-fidelity with parent classifier reference
### Changes
- Add `classifier` field to `Parent` in `maven.mdo` (4.1.0+)
- `DefaultConsumerPomBuilder`: add `stripTo400()` and dual POM generation logic
- `ConsumerPomArtifactTransformer`: handle `consumer-full` artifact lifecycle and remap during install/deploy
- `DefaultModelResolver`: pass parent classifier during external resolution
- `DefaultModelBuilder`: skip local parent resolution when classifier is set
Fixes #11772
## Test plan
- [x] New IT `MavenITgh11772DualConsumerPomTest` verifies dual POM generation
- [x] Existing consumer POM ITs pass without regressions
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-11772] Generate dual consumer POMs for parent POMs with 4.1.0 features [maven]
Posted by "slawekjaranowski (via GitHub)" <gi...@apache.org>.
slawekjaranowski commented on PR #11775:
URL: https://github.com/apache/maven/pull/11775#issuecomment-4157610677
@gnodet do you need a branch as PR is closed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-11772] Generate dual consumer POMs for parent POMs with 4.1.0 features [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #11775:
URL: https://github.com/apache/maven/pull/11775#issuecomment-4032263592
Closing this PR — after further analysis, the dual consumer POM approach adds significant complexity that is not justified.
**Key insight**: Maven 4 can already resolve the `build` classifier POM for full-fidelity parent resolution. There is no need for a separate `consumer` classifier POM.
The simpler approach is:
1. Keep flattening as the mechanism for backward-compatible (4.0.0) consumer POMs
2. Add a flag to control managed dep removal during flattening (for users who want correctness over POM size)
3. Validate at build time: if flattening is disabled and the parent has 4.1.0+ features that would be lost in the consumer POM, reject the build
See discussion on #11772 for the full reasoning.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [GH-11772] Generate dual consumer POMs for parent POMs with 4.1.0 features [maven]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed pull request #11775: [GH-11772] Generate dual consumer POMs for parent POMs with 4.1.0 features
URL: https://github.com/apache/maven/pull/11775
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org