You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Carlos Santos <gl...@gmail.com> on 2007/07/03 23:09:54 UTC

Plugin Inheritence Issue

I have a master POM with packaging set as pom. This is a multi-module POM.
Is there a way to run a maven plugin once instead of for each module? From
what I read in the docs it seems that setting the packaging to pom means
that every module listed inherits from the parent. I've tried setting
inherit to false with no results (does inherit only turn on/off inheriting
configurations?).

Any suggestions?

Re: Plugin Inheritence Issue

Posted by Frederic Simon <fr...@jfrog.org>.
Sorry for the late answer.
There is "isExecutionRoot()" which tells you from where (usually the parent)
maven is executed.
But me, I do the ugly hack of checking if the project is the last one in the
reactor list...
    @MojoParameter(expression = "${reactorProjects}", required = true,
readonly = true)
    protected List<MavenProject> reactorProjects;

    MavenProject lastproject = reactorProjects.get(nbProjects - 1);
    if (lastproject.isExecutionRoot()) {

Not nice but it always works.

On 7/4/07, Carlos Santos <gl...@gmail.com> wrote:
>
> Frederic, I was aware that you could tie the plugin to a phase or
> packaging
> type, however how would one have it run for the last project in the list?
>
> Regards,
> CS
>
> On 7/3/07, Frederic Simon <fr...@jfrog.org> wrote:
> >
> > It's the plugin job to be an "Aggregator" (run once per execution), or
> to
> > run only on certain packaging type, or to run for the last project in
> the
> > list. You cannot control it from the POM configuration.
> >
> > On 7/4/07, Carlos Santos <gl...@gmail.com> wrote:
> > >
> > > I have a master POM with packaging set as pom. This is a multi-module
> > POM.
> > > Is there a way to run a maven plugin once instead of for each module?
> > From
> > > what I read in the docs it seems that setting the packaging to pom
> means
> > > that every module listed inherits from the parent. I've tried setting
> > > inherit to false with no results (does inherit only turn on/off
> > inheriting
> > > configurations?).
> > >
> > > Any suggestions?
> > >
> >
> >
> >
> > --
> > "CapsLock Key is like rear mirrors in BMW! Who needs them?"
> > freddy33
> >
>



-- 
"CapsLock Key is like rear mirrors in BMW! Who needs them?"
freddy33

Re: Plugin Inheritence Issue

Posted by Carlos Santos <gl...@gmail.com>.
Frederic, I was aware that you could tie the plugin to a phase or packaging
type, however how would one have it run for the last project in the list?

Regards,
CS

On 7/3/07, Frederic Simon <fr...@jfrog.org> wrote:
>
> It's the plugin job to be an "Aggregator" (run once per execution), or to
> run only on certain packaging type, or to run for the last project in the
> list. You cannot control it from the POM configuration.
>
> On 7/4/07, Carlos Santos <gl...@gmail.com> wrote:
> >
> > I have a master POM with packaging set as pom. This is a multi-module
> POM.
> > Is there a way to run a maven plugin once instead of for each module?
> From
> > what I read in the docs it seems that setting the packaging to pom means
> > that every module listed inherits from the parent. I've tried setting
> > inherit to false with no results (does inherit only turn on/off
> inheriting
> > configurations?).
> >
> > Any suggestions?
> >
>
>
>
> --
> "CapsLock Key is like rear mirrors in BMW! Who needs them?"
> freddy33
>

Re: Plugin Inheritence Issue

Posted by Frederic Simon <fr...@jfrog.org>.
It's the plugin job to be an "Aggregator" (run once per execution), or to
run only on certain packaging type, or to run for the last project in the
list. You cannot control it from the POM configuration.

On 7/4/07, Carlos Santos <gl...@gmail.com> wrote:
>
> I have a master POM with packaging set as pom. This is a multi-module POM.
> Is there a way to run a maven plugin once instead of for each module? From
> what I read in the docs it seems that setting the packaging to pom means
> that every module listed inherits from the parent. I've tried setting
> inherit to false with no results (does inherit only turn on/off inheriting
> configurations?).
>
> Any suggestions?
>



-- 
"CapsLock Key is like rear mirrors in BMW! Who needs them?"
freddy33