kec opened a new pull request, #13768:
URL: https://github.com/apache/maven/pull/13768

   Fixes #13761.
   
   ### What
   
   Since MNG-8709 (#12684) `DefaultConsumerPomBuilder.buildModel` passes the 
properties of every profile in `project.getActiveProfiles()` as request user 
properties of the `BUILD_CONSUMER` model build, so that coordinates those 
profiles supply interpolate and validate. `DefaultModelBuilder` then uses the 
request's user properties as the override map that is written into the model's 
`<properties>` and into every profile's properties. Those two uses of one map 
are what bakes the producer's environment into the consumer POM: a 
file-activated profile's values end up in the main block, an opt-in profile is 
rewritten to the opposite of its purpose, and an OS profile for another 
platform carries the producer's classifier (the reproducer and a real-world 
parent POM are in the issue).
   
   This change gives the override step its own source: for a `BUILD_CONSUMER` 
request it takes the session's user properties, which is what the user actually 
passed; every other build request keeps the request's user properties, which 
the project builder lets a caller tailor. The MNG-8709 injection and its tests 
are untouched, so interpolation and validation still see the profile properties.
   
   ### Tests
   
   - `ConsumerPomBuilderTest`: two unit tests on a project with a 
file-activated, a property-activated and an OS-activated profile. Declared 
values survive in the main block and in each profile; a `-D` user property 
still overrides a declared value. Both fail on `master` without the change (the 
main block comes back `flag=true, classifier=here`).
   - `MavenITgh13761ConsumerPomProfilePropertiesTest`: installs the same 
project and parses the consumer POM back with `MavenStaxReader`, same 
assertions, plus the `-D` override case.
   
   ### Backport
   
   The same block is on `maven-4.0.x` (the 4.0.0 milestone has no open items). 
I can open the backport once this lands.
   


-- 
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]

Reply via email to