You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Smiley <ds...@mitre.org> on 2006/05/26 17:00:43 UTC

inherited plugins for module use

I'm trying to understand how maven determines when to use plugins for a module.

I have a parent pom and many modules.  I noticed that if I put a 
<pluginManagement> in the parent and specify the xdoclet maven plugin 
configured for the "generate-resources" phase, that it gets executed 
when that phase comes due at the module level -- except for when there 
are no files for xdoclet to process.  So it appears smart like that but 
I don't know how that is orchestrated.

I am trying to get the antrun plugin to behave similarly, but it didn't 
work when I set it up similarly.  That is, specifying the plugin in the 
<pluginManagement> of the parent pom, for the generate-sources goal.  
It doesn't get executed.  (note: it's not actually generating sources, 
it's generating other files needed by assembly:assembly).  I 
experimented and put it in /project/build/plugins and low and behold, 
it is executed now.

What's going on?  Please enlighten me... and better yet, point me to 
documentation for this 'cause I haven't found it.

~ David Smiley



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


Re: inherited plugins for module use

Posted by David Smiley <ds...@mitre.org>.
On 2006-05-26 11:08:28 -0400, Roland Asmann <Ro...@cfc.at> said:

> Try adding the antrun-plugin in your modules in the <plugins>-section. 
> You can ommit the configuration, since
> you already have that (I presume) in your parent POM in the 
> <pluginManagement>-section...

I have many modules that I want to run this... so to keep with the DRY 
principle (don't repeat yourself); I'll keep it in the parent in 
/project/build/plugins

> Not sure about where this is written (if it is at all), but it should 
> work like this...
> 
> PluginManagement is sort of a definition for plugins, which MUST be 
> explicitly activated (if not pre-defined in the
> build lifecycle) by adding them in the POM.

If that is so then how is xdoclet being activated despite it only being 
mentioned in pluginManagement?

> 
> Hope this helped,
> 
> Roland
> 
> 
> 
> On Friday 26 May 2006 17:00, David Smiley wrote:
>> I'm trying to understand how maven determines when to use plugins for a
>> module.
>> 
>> I have a parent pom and many modules.  I noticed that if I put a
>> <pluginManagement> in the parent and specify the xdoclet maven plugin
>> configured for the "generate-resources" phase, that it gets executed
>> when that phase comes due at the module level -- except for when there
>> are no files for xdoclet to process.  So it appears smart like that but
>> I don't know how that is orchestrated.
>> 
>> I am trying to get the antrun plugin to behave similarly, but it didn't
>> work when I set it up similarly.  That is, specifying the plugin in the
>> <pluginManagement> of the parent pom, for the generate-sources goal.
>> It doesn't get executed.  (note: it's not actually generating sources,
>> it's generating other files needed by assembly:assembly).  I
>> experimented and put it in /project/build/plugins and low and behold,
>> it is executed now.
>> 
>> What's going on?  Please enlighten me... and better yet, point me to
>> documentation for this 'cause I haven't found it.
>> 
>> ~ David Smiley
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org




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


Re: inherited plugins for module use

Posted by Roland Asmann <Ro...@cfc.at>.
Try adding the antrun-plugin in your modules in the <plugins>-section. You can ommit the configuration, since
you already have that (I presume) in your parent POM in the <pluginManagement>-section...
Not sure about where this is written (if it is at all), but it should work like this...

PluginManagement is sort of a definition for plugins, which MUST be explicitly activated (if not pre-defined in the
build lifecycle) by adding them in the POM.

Hope this helped,

Roland



On Friday 26 May 2006 17:00, David Smiley wrote:
> I'm trying to understand how maven determines when to use plugins for a
> module.
>
> I have a parent pom and many modules.  I noticed that if I put a
> <pluginManagement> in the parent and specify the xdoclet maven plugin
> configured for the "generate-resources" phase, that it gets executed
> when that phase comes due at the module level -- except for when there
> are no files for xdoclet to process.  So it appears smart like that but
> I don't know how that is orchestrated.
>
> I am trying to get the antrun plugin to behave similarly, but it didn't
> work when I set it up similarly.  That is, specifying the plugin in the
> <pluginManagement> of the parent pom, for the generate-sources goal.
> It doesn't get executed.  (note: it's not actually generating sources,
> it's generating other files needed by assembly:assembly).  I
> experimented and put it in /project/build/plugins and low and behold,
> it is executed now.
>
> What's going on?  Please enlighten me... and better yet, point me to
> documentation for this 'cause I haven't found it.
>
> ~ David Smiley
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


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