gnodet commented on pull request #690: URL: https://github.com/apache/maven/pull/690#issuecomment-1064950742
> Just for references as I recently added support for project-scoped WorkspaceReaders, if you like to support such components one needs to add explicit support for them similar to: > > [...] > > as you see, the calling code should also be aware that there are _multiple_ items and has to handle this (combine, call in a row, throw exception ...). I tend to think that the current design is somewhat broken if whenever you need to lookup a component, you need to go through a complex setup in order to find where to load the component from. The plexus container has support for importing from various _visible_ realms. I think at each stage of the build (after entering the session scope, during the build of a given project, during the execution of a mojo), a corresponding realm should be setup and associated to the TCCL so that lookups can be performed with the correct visibility and scope. Failing to setup such a realm with result in an inability to do loops correctly : as you explained for looking up a list, but for a single component, you'd have to deal with priority, ordering and all concerns that should be left to the container. > > but other think defining extensions in the pom is preferable > > Just in case you don't know it (and to save you from to much hassle) it is no longer required to define core-extensions in `lib/ext` you can simply define them in `.mvn/extensions.xml` of the project, and I think that's what you actually try to arcive by your "master-project-classloader" see here for the documentation: https://maven.apache.org/ref/3.8.4/maven-embedder/core-extensions.html > > You can take a look here for an example of the tycho-build extension that is a core-extension: https://github.com/eclipse/tycho/tree/master/tycho-its/projects/reactor.makeBehaviour Thx, I did set up the tests for the `m-build-cache-e` using `.mvn/extensions.xml` so that's definitely not an issue. -- 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