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

   ## Summary
   
   Forward-port of a review fix from 
[#13545](https://github.com/apache/maven/pull/13545) (maven-4.0.x backport of 
#13471).
   
   ## Root Cause
   
   When `DefaultModelBuilder` activates parent profiles (for #10375), it calls
   `recording.start(model.getProperties())`. On master, `start(Map)` implemented
   this by mutating the context model via `model.withProperties(parentProps)`,
   which caused `getModelProperty()` to return the **parent POM's own declared
   properties**. This allowed parent POM properties to self-activate
   property-based or condition-based profiles — exactly what #13390 was meant to
   prevent.
   
   ## Fix
   
   Introduce a separate `interpolationProperties` field in
   `DefaultProfileActivationContext` that is used **only** inside 
`interpolate()`
   (i.e. `interpolatePath()`), and is **never** exposed through
   `getModelProperty()`.
   
   - `start(Map)` now stores the map as `interpolationProperties` instead of
     calling `model.withProperties()`.
   - `interpolate()` checks `interpolationProperties` before 
`getModelProperty()`
     so path placeholders (e.g. `${message.file}` in file-activated profiles)
     still resolve against parent properties (#10375).
   - `getModelProperty()` continues to read from the model's own properties, so
     POM-declared property conditions correctly do not fire (#13390).
   
   This was identified during the review of #13545 and applied there but not
   forward-ported to master.
   
   Fixes #13390 (regression path via #10375 fix).
   
   _Hermes Agent (Claude Sonnet 4.6) on behalf of Guillaume Nodet_
   


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