gnodet commented on pull request #690:
URL: https://github.com/apache/maven/pull/690#issuecomment-1065402650


   > > Isn't that exactly the opposite of what is done for lifecycle 
participants and workspace readers at boot time ? Those are loaded from all 
registered extensions for all projects and are active for the whole build.
   > 
   > But each of those are loaded from their own classloader (there is no 
shared one) if they are defined at the project level. If they are defined as 
core-extension they are all loaded from the "maven-core-realm", that's why I 
said if you want to be on the "global-scope" (thus all projects are sharing the 
same instance) you should use a maven-core extension.
   
   But I'm not talking about changing the class loaders, just the visibility 
for beans with plexus lookup.  I don't see why `WorkspaceReader` and 
`AbstractMavenLifecycleParticipant` should be treated differently than any 
other lookup.
   
   > The whole caching-story for me sounds as if it is more suitable as a 
core-extension, for example tycho is defined on a per project level, but we 
check as the very first step that **all** projects in the reactor are using the 
same tycho version and fail the build if not. Neverless my goal is to make 
tycho a pure core-extension because project-scoped is much more limited and 
requires special care.
   
   Core extensions are not loaded if you're aggregating multiple projects as 
you hinted earlier, so I guess it really depends on the use case.  I don't 
really any good reason to not try to support both.
   
   I've added a commit which explains my thoughts : a single ClassRealm is 
created with all extensions (and not only the ones from top level or the last 
project).  This realm is not used to load classes from, it's only used for 
lookups.  It's created as early as possible after the projects are created and 
used as the context classloader.  It removes the need for explicit lookup in 
those realms for workspace readers and lifecycle participants.
   


-- 
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: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to