You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by amaresh mourya <am...@gmail.com> on 2011/04/11 10:39:05 UTC
Default phase of a plugin
Hi All,
I created my own plugin and bind a goal to 'install' phase via '@phase
install' in the goal's MOJO. My question is if I run this goal via
myPlugin:Mygoal in command line, will it execute all the previous phases? I
am expecting all phases above install to be exceuted, that are
(validate,compile,test,package, integration-test, verify etc).
I am hoping this to happen because same thin happens when we run 'mvn
package', it executes all the previous phases before package. On the
contrary I found this link over the discussion and I got confused.
http://www.mail-archive.com/users@maven.apache.org/msg105538.html
If any goal ran from the command line doesn't go through lifecycle phase
then how mvn package executes all the previous phases of it.
Thanks
--Amaresh
Re: Default phase of a plugin
Posted by Tim Kettler <ti...@udo.edu>.
Am 11.04.2011 10:39, schrieb amaresh mourya:
> Hi All,
Hi,
> I created my own plugin and bind a goal to 'install' phase via '@phase
> install' in the goal's MOJO. My question is if I run this goal via
> myPlugin:Mygoal in command line, will it execute all the previous phases? I
> am expecting all phases above install to be exceuted, that are
> (validate,compile,test,package, integration-test, verify etc).
No, if you run maven with a single goal given in the commandline it will
just execute that goal. Nothing else.
>
> I am hoping this to happen because same thin happens when we run 'mvn
> package', it executes all the previous phases before package. On the
> contrary I found this link over the discussion and I got confused.
> http://www.mail-archive.com/users@maven.apache.org/msg105538.html
>
> If any goal ran from the command line doesn't go through lifecycle phase
> then how mvn package executes all the previous phases of it.
You've got that wrong. 'package' isn't a *goal* but a *phase* in the
default build lifecyle [1]. When you invoke a phase, all phases before
are executed, too.
> Thanks
> --Amaresh
>
-Tim
[1]
http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org