You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Manisha Sur <ma...@gmail.com> on 2006/02/16 14:58:30 UTC

custom goal doesn't run ?

Hi ,

i have a goal defined in the root's maven.xml as follows:

 <goal name="petstore:build">
    <j:set var="goal" value="clean,petstore:build"/>
    <attainGoal name="multiproject:goal"/>
  </goal>

the intent is to run clean for each of the subprojects and then run the
custom 'petstore:build' goal for each subproject.
each of the subproject defines the petstore:build goal in the maven.xml ,
with there respective install like :

<goal name="petstore:build" prereqs="ejb:install"/>

when i run the petstore:build goal from the root, only the clean goal gets
executed. no ejb:install is called for the subproject.
But If i run "maven multiproject:goal -Dgoal=clean,petstore:build" from the
root, it does both the clean and install.
so why its not working in the first case ? how to tackle this problem ?

--
Warm Regards
Manisha Sur

Re: custom goal doesn't run ?

Posted by Manisha Sur <ma...@gmail.com>.
I am using Maven 1.1 Beta 2 .

On 2/16/06, Arnaud HERITIER <ah...@gmail.com> wrote:
>
> Which maven release are you using ?
> In one of the subprojects, do you use another multiproject goal ?
>
> Arnaud
>
> On 2/16/06, Manisha Sur <ma...@gmail.com> wrote:
> > Hi ,
> >
> > i have a goal defined in the root's maven.xml as follows:
> >
> >  <goal name="petstore:build">
> >    <j:set var="goal" value="clean,petstore:build"/>
> >    <attainGoal name="multiproject:goal"/>
> >  </goal>
> >
> > the intent is to run clean for each of the subprojects and then run the
> > custom 'petstore:build' goal for each subproject.
> > each of the subproject defines the petstore:build goal in the maven.xml,
> > with there respective install like :
> >
> > <goal name="petstore:build" prereqs="ejb:install"/>
> >
> > when i run the petstore:build goal from the root, only the clean goal
> gets
> > executed. no ejb:install is called for the subproject.
> > But If i run "maven multiproject:goal -Dgoal=clean,petstore:build" from
> the
> > root, it does both the clean and install.
> > so why its not working in the first case ? how to tackle this problem ?
> >
> > --
> > Warm Regards
> > Manisha Sur
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
Warm Regards
Manisha Sur

Re: custom goal doesn't run ?

Posted by Arnaud HERITIER <ah...@gmail.com>.
Which maven release are you using ?
In one of the subprojects, do you use another multiproject goal ?

Arnaud

On 2/16/06, Manisha Sur <ma...@gmail.com> wrote:
> Hi ,
>
> i have a goal defined in the root's maven.xml as follows:
>
>  <goal name="petstore:build">
>    <j:set var="goal" value="clean,petstore:build"/>
>    <attainGoal name="multiproject:goal"/>
>  </goal>
>
> the intent is to run clean for each of the subprojects and then run the
> custom 'petstore:build' goal for each subproject.
> each of the subproject defines the petstore:build goal in the maven.xml ,
> with there respective install like :
>
> <goal name="petstore:build" prereqs="ejb:install"/>
>
> when i run the petstore:build goal from the root, only the clean goal gets
> executed. no ejb:install is called for the subproject.
> But If i run "maven multiproject:goal -Dgoal=clean,petstore:build" from the
> root, it does both the clean and install.
> so why its not working in the first case ? how to tackle this problem ?
>
> --
> Warm Regards
> Manisha Sur
>
>

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


Re: custom goal doesn't run ?

Posted by Lukas Theussl <lt...@apache.org>.
A prereq is always only called once in a build cycle. This is by design, 
since you usually don't want the same goal to be executed again if it 
has been executed once already. If you want to make sure it gets 
executed, you should use <attainGoal> in your sub-projects, ie

<goal name="petstore:build">
   <attainGoal name="ejb:install"/>
</goal>


HTH,
Lukas


Manisha Sur wrote:
> Hi ,
> 
> i have a goal defined in the root's maven.xml as follows:
> 
>  <goal name="petstore:build">
>     <j:set var="goal" value="clean,petstore:build"/>
>     <attainGoal name="multiproject:goal"/>
>   </goal>
> 
> the intent is to run clean for each of the subprojects and then run the
> custom 'petstore:build' goal for each subproject.
> each of the subproject defines the petstore:build goal in the maven.xml ,
> with there respective install like :
> 
> <goal name="petstore:build" prereqs="ejb:install"/>
> 
> when i run the petstore:build goal from the root, only the clean goal gets
> executed. no ejb:install is called for the subproject.
> But If i run "maven multiproject:goal -Dgoal=clean,petstore:build" from the
> root, it does both the clean and install.
> so why its not working in the first case ? how to tackle this problem ?
> 
> --
> Warm Regards
> Manisha Sur
> 

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