You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason Dillon <ja...@planet57.com> on 2007/08/11 06:37:52 UTC

An easy way to merge 2 plugin.xml's into one?

Is there an _easy_ way to merge 2 plugin.xml's into one?  Basically  
taking the <mojos> and <dependencies> bits from one plugin.xml and  
including them into another.

I can think of a few hacky ways to do it... but just curious if  
anyone knows of a nice API er something?

--jason

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: An easy way to merge 2 plugin.xml's into one?

Posted by Jason van Zyl <ja...@maven.org>.
On 12 Aug 07, at 5:53 AM 12 Aug 07, Jason Dillon wrote:

> On Aug 11, 2007, at 5:05 AM, Kenney Westerhof wrote:
>> In Maven-project, there's org.apache.maven.project.ModelUtils,  
>> which has some
>> methods to merge plugin definitions.
>
> Okay, thanks I will have a peek.
>
>
>> Just curious, what do you need this for?
>
> Well, basically, I want to create a plugin, which will depend on  
> another plugin as a compile dependency, and then have the new  
> plugin pick up all of the other plugins goals and dependency  
> configuration.  Basically, I want to _extend_ an entire plugin.
>

Right, including the component information. I get it.

That would be cool, but you might want to look at trying to do this  
at the Plexus level. We have a bit of a disparity at this point in  
time because the Mojo processing tools are slightly different then  
the component processing tools in Plexus. Generally if one component  
extends another you want to utilize any existing component  
information. So any tool would need to know to step into the JAR  
extract the metadata and use that for extension. I am assuming this  
is what you mean. But if you are going to start this then the best  
solution, though by no means the easiest, is to teach to Plexus' CDC  
how to do this generally. The CDC is a more general version of the  
Mojo descriptor generator which produces the plugin.xml. The  
plugin.xml is really a Plexus component descriptor in disguise.

> I'm trying to play around with how I can use more Groovy code in  
> the modules that support the groovy-maven-plugin, so I am playing  
> with a bootstrap plugin that just contains all of the goals to  
> compile... there about about 5 of them right now.  But I don't want  
> to have a compiler plugin and then a groovy plugin, I want them all  
> in the same plugin, but I also want to write some of the other  
> goals in Groovy, which becomes well... not easy ;-)
>
> So, I'm just experimenting with some ways to do it better... and  
> thats where the idea to have one plugin extend another came from.
>

Really general component extension.

> --jason
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder and PMC Chair, Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: An easy way to merge 2 plugin.xml's into one?

Posted by Jason Dillon <ja...@planet57.com>.
On Aug 11, 2007, at 5:05 AM, Kenney Westerhof wrote:
> In Maven-project, there's org.apache.maven.project.ModelUtils,  
> which has some
> methods to merge plugin definitions.

Okay, thanks I will have a peek.


> Just curious, what do you need this for?

Well, basically, I want to create a plugin, which will depend on  
another plugin as a compile dependency, and then have the new plugin  
pick up all of the other plugins goals and dependency configuration.   
Basically, I want to _extend_ an entire plugin.

I'm trying to play around with how I can use more Groovy code in the  
modules that support the groovy-maven-plugin, so I am playing with a  
bootstrap plugin that just contains all of the goals to compile...  
there about about 5 of them right now.  But I don't want to have a  
compiler plugin and then a groovy plugin, I want them all in the same  
plugin, but I also want to write some of the other goals in Groovy,  
which becomes well... not easy ;-)

So, I'm just experimenting with some ways to do it better... and  
thats where the idea to have one plugin extend another came from.

--jason



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: An easy way to merge 2 plugin.xml's into one?

Posted by Kenney Westerhof <ke...@apache.org>.
In Maven-project, there's org.apache.maven.project.ModelUtils, which has some
methods to merge plugin definitions.

Just curious, what do you need this for?

-- Kenney

Jason Dillon wrote:
> Is there an _easy_ way to merge 2 plugin.xml's into one?  Basically 
> taking the <mojos> and <dependencies> bits from one plugin.xml and 
> including them into another.
> 
> I can think of a few hacky ways to do it... but just curious if anyone 
> knows of a nice API er something?
> 
> --jason
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org