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

   ## Summary
   
   - **Root cause**: `DefaultExtensibleEnumRegistry.lookup()` calls 
`Lookup.lookupList()` to find SPI providers (e.g. `PackagingProvider` from 
project extensions), which returns ALL providers registered with SISU globally 
— no classloader filtering. In a reactor build, Maven 4's model builder 
processes modules in parallel via `PhasingExecutor`, so an extension loaded for 
one module can leak its providers into sibling modules.
   - **Symptom**: `MavenITgh13306PackagingProviderTest` is flaky on 
Windows+JDK27 — the `without-extension` module sometimes resolves `app-client` 
packaging from `with-extension`'s leaked provider.
   - **Fix**: Before considering a dynamically-discovered SPI provider, verify 
its class is loadable from the current thread's context classloader (set to the 
project's realm by `selectProjectRealm()` before packaging resolution). 
Providers from extension realms are only visible to projects whose realm 
imports that extension.
   
   ## Test plan
   
   - [x] `DefaultExtensibleEnumRegistryTest` passes (lambda providers handled 
via hidden-class fallback)
   - [x] `DefaultPackagingRegistryTest` passes (legacy LifecycleMapping 
fallback unaffected)
   - [x] Full `maven-impl` test suite passes
   - [ ] CI: `MavenITgh13306PackagingProviderTest` should become stable on 
Windows+JDK27
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


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