Revisiting MNG-6209 (inconsistent activation of components from multiple extensions=true plugins) revisited

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Revisiting MNG-6209 (inconsistent activation of components from multiple extensions=true plugins) revisited

rfscholte
This was the issue reverted after 3.5.1, which should deserve a revisit.
Stephen created a sample project[1] to show the effects when working with  
extensions
I've created a matrix[2] with the changes of behavior between 3.5.0 and  
3.5.1
There's also documentation about this topic[3], especially the plugin  
classloaders-chapter is of interest here.

I first want to agree on what should be visible at every stage, so let me  
try to make a start (I ignore the order of loading for now):

1. Consider a plugin containing:
     @Component(role = Lifecycle.class)
     private List<Lifecycle> lifecycles;

   In this case it must see all Lifecycle instances, getting them from  
extensions, plugins marked as extension and the plugin itself.

2. The Plugin Classloader should only contain the plugin classes, it  
should NOT have access to extensions.

3. The Thread CL, I don't have an answer for that yet. In Maven 3.5.0 it  
was always the same the Plugin CL, but in Maven 3.5.1 it often wasn't.  
Maybe the most important question is: when do you want to switch to the  
Thread CL?

To make the discussion a little bit better to understand: Have a look at  
the ListMojo[4] and wonder for every classloader: should it have access to  
a specific resource? e.g. we discovered that maven-assembly-plugin

Also have a look at earlier discussion[5]

IMO Maven does have incorrect behavior right now. e.g. if I want to use  
scm-local with maven-release-plugin (for demo purpose) I must add it as a  
dependency to the plugin, whereas the correct way is to add it as an  
extension.

So it would be great to have this fixed in Maven 3.6.x

thanks,
Robert

[1] https://github.com/stephenc/mng-6209
[2]  
https://cwiki.apache.org/confluence/download/attachments/2329841/classrealms.pdf?api=v2
[3]  
https://svn.apache.org/repos/infra/websites/production/maven/content/reference/maven-classloading.html
[4]  
https://github.com/stephenc/mng-6209/blob/master/plugin1/src/main/java/localdomain/localhost/plugin1/ListMojo.java
[5] https://maven.markmail.org/thread/2rytungr2iyomhji

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]