gnodet commented on PR #13348:
URL: https://github.com/apache/maven/pull/13348#issuecomment-6035787267

   Looking at the fix more carefully, this only addresses Maven 4 API plugins 
(the `enhanced` configurator). Maven 3-style plugins use the `basic` 
configurator (`BasicComponentConfigurator` from sisu-plexus), which has the 
same bug.
   
   The routing in `DefaultMavenPluginManager`:
   ```java
   configuratorId = mojoDescriptor.isV4Api() ? "enhanced" : "basic";
   ```
   
   Both `AbstractBasicConverter.fromExpression()` (sisu-plexus) and the pre-PR 
`EnhancedConfigurationConverter.fromExpression()` had identical logic:
   - `value = configuration.getValue()`  
   - Skip evaluation if `value == null || value.isEmpty()`  → returns `null` → 
Java default preserved
   
   The PR fixes `EnhancedConfigurationConverter` and adds 
`EnhancedStringConverter` to `EnhancedConverterLookup`. But 
`BasicComponentConfigurator` uses `DefaultConverterLookup` with no custom 
converters, so the stock `StringConverter` (which just passes through the 
string) is still bypassed when the value is empty — the `fromExpression` filter 
in `AbstractBasicConverter` prevents `fromString("")` from ever being called.
   
   To fix this consistently, either:
   1. The fix needs to go into sisu-plexus itself 
(`AbstractBasicConverter.fromExpression()` should distinguish `null` from 
`""`), or
   2. Maven should register a custom `BasicComponentConfigurator` subclass for 
the `basic` role-hint that also uses `EnhancedStringConverter`.
   
   Option 2 is fully within Maven's control and doesn't require a sisu-plexus 
release.
   


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