geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Dillon <ja...@planet57.com>
Subject Re: PackageBuilderShellMojo (m2) and classloaders
Date Tue, 11 Jul 2006 18:41:22 GMT
Thanks for following up on this.

Would have been nice if there were comments in the codebase to this  
effect.

Was there any reason why the setters were all invoked through  
reflection as well?

--jason


On Jul 11, 2006, at 8:43 AM, David Jencks wrote:

> Jason Dillon asked last night on IRC why the PackgeBuilderShellMojo  
> for the m2 packaging plugin used reflection to create the  
> PackageBuilder.  We need to control the classloader for  
> PackageBuilder pretty closely so it has the same classpath as j2ee- 
> system.  In maven 1, IIUC, plugins get instantiated using a child  
> classloader of the project calling the plugin: this classloader  
> typically has a more or less random selection of large numbers of  
> geronimo jars in it, far more than j2ee-system, and in particular  
> including all the classes for the dependencies of the module/ 
> configuration you are trying to build.  The only solution I could  
> see for m1 was to construct a classloader myself and load  
> PackageBuilder in my own classloader and access the instance by  
> reflection.
>
> I believe the situation is better in m2 and that the plugin is  
> instantiated using a classloader determined solely by the plugin's  
> pom.  If so, we should be safe in eliminating this extra reflection  
> code and in fact using PackageBuilder directly without the  
> "shell".  If not, we should keep using the inconvenient reflection  
> code.
>
> thanks
> david jencks
>


Mime
View raw message