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

   Port of the settings interpolation fix from 3.10.x (commit 24deab9b74, fixes 
#11011).
   
   ## Problem
   
   Settings interpolation only worked for String fields. Non-String fields such 
as
   `proxy.port` (int) and `proxy.active` (boolean) containing `${...}` property
   placeholders would fail to parse or silently use default values. 
Additionally,
   settings XML parsing errors were always downgraded to `WARNING`, making it 
hard
   to detect malformed settings files.
   
   ## Fix
   
   1. **Raw XML interpolation before parsing**: property placeholders are now 
resolved
      at the raw XML text level before the StAX/Modello parser converts element 
content
      to typed fields (`int`, `boolean`, etc.). Post-parse interpolation via
      `SettingsTransformer` is retained for custom `SettingsParser` 
implementations
      that return pre-built `Settings` objects.
   
   2. **Strict parsing mode**: a new system property 
`maven.settings.strictParsing`
      (constant `Constants.MAVEN_SETTINGS_STRICT_PARSING`) controls how XML 
parsing
      errors are reported. When set to `"true"`, parsing errors that were 
previously
      downgraded to `WARNING` are now `FATAL`, causing the build to fail 
immediately.
   
   ## Changes
   
   - `Constants.java`: added `MAVEN_SETTINGS_STRICT_PARSING` constant
   - `DefaultSettingsBuilder.java`: added `interpolateSource()` wrapping method 
for
     raw XML interpolation; strict parsing logic in `readSettings()`
   - Test: proxy interpolation test with `${test.proxy.port}` and 
`${test.proxy.active}`
   - Test resource: `settings-proxy-interpolation.xml`
   
   Co-authored-by: Tamas Cservenak <[email protected]>
   
   _Hermes Agent (Claude Opus 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