gnodet opened a new pull request, #11463:
URL: https://github.com/apache/maven/pull/11463
## Description
This PR adds validation to prevent creating consumer POMs when mixins are
present without flattening enabled.
## Changes
- **Added validation in `DefaultConsumerPomBuilder`**: Checks for mixins
when flattening is disabled and throws `MavenException` with a helpful error
message
- **Added integration test `MavenITgh11456MixinsConsumerPomTest`** with two
scenarios:
1. `testMixinsWithoutFlattening`: Verifies build fails with proper error
message
2. `testMixinsWithFlattening`: Verifies build succeeds and mixins are
removed from consumer POM when flattening is enabled
- **Created test resources**: POMs using mixins with local repository
containing mixin artifacts
## Problem
Mixins require model version 4.2.0 and cannot be part of the consumer POM.
When consumer POM flattening is disabled (`maven.consumer.pom.flatten=false`),
mixins would remain in the consumer POM, which is invalid.
## Solution
Maven now fails early with a clear error message that guides users to either:
- Enable flattening by setting `maven.consumer.pom.flatten=true`, or
- Remove mixins from their POM
## Testing
- Full build passes: `mvn clean install -DskipTests`
- Code formatting verified: `mvn spotless:check`
- Integration tests created to verify both failure and success scenarios
Fixes https://github.com/apache/maven/issues/11456
---
Pull Request opened by [Augment Code](https://www.augmentcode.com/) with
guidance from the PR author
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]