gnodet opened a new issue, #13516:
URL: https://github.com/apache/maven/issues/13516

   **Parent:** #13499 | **Related:** #13465, #13223
   
   ## Problem
   
   There is no v4 API for discovering SPI implementations contributed by a 
specific
   plugin's classloader. Today this requires internal APIs: 
`BuildPluginManager.getPluginRealm()`,
   `MavenPluginManager.getPluginDescriptor()`, and 
`PlexusContainer.lookupList()` with
   thread context classloader switching.
   
   ## Who needs this
   
   - **Tycho**: `DefaultPluginRealmHelper` discovers Tycho SPI extensions from 
plugin
     dependencies. For each plugin with `tycho-spi` in its dependency tree, it 
switches
     the thread context classloader to the plugin's ClassRealm and performs 
Plexus lookups
     for SPI implementations. This is Tycho's extensibility model — third-party 
plugins
     contribute SPI implementations loaded from their class realm.
   
   ## What's needed
   
   - Plugin descriptor/dependency introspection API — enumerate a plugin's 
resolved
     dependencies without internal `MavenPluginManager`
   - Scoped service lookup — find services contributed by a specific plugin's 
classloader,
     not just global lookups
   - Intersects with #13223 Layer 1 (per-realm import descriptor) — laeubi's 
comment on
     #13223 proposes that plugins should be able to declare SPI artifacts that 
share classes
     with extensions, which would be the declarative solution to this problem
   
   <!-- AI-Agent-Disclosure -->
   > 🤖 Drafted with Claude Code (Claude Opus 4.6, interactive mode). Reviewed 
and confirmed by @gnodet before submission.


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