The @phase will automatically cause a plugin to run at that phase, but
the plugin must still be mentioned in the pom. 

-----Original Message-----
From: Pankaj Tandon [mailto:pankajtan...@gmail.com] 
Sent: Thursday, April 02, 2009 10:40 AM
To: users@maven.apache.org
Subject: Re: [ANN] Maven 2.1.0 Released


Hello Rob,
I wanted to ask you about your comment below where you state that even
if you have an annotation in a mojo for the execution phase, you still
have to declare an executions element for the very same phase in the
project that invkes this plugin.

That, kind of defeats the purpose of having a default phase specified in
the Mojo, does it not? And it certainly doesn't work that way for other
plugins (the war plugin for instance that is bound to the package
phase).

So am I missing something here or is this a bug introduced with 2.0.10?

Thanks
Pankaj


Okay, my mistake - although it was indeed the 2.1.0 mvn which was in my
path, I had forgotten to change the value of my M2_HOME environment
variable.

Therefore, it was actually 2.0.10 which was being executed, which was
why my
goal was being ignored.

And anyway, I had wrongly assumed that adding the '@phase
prepare-package'
annotation to the mojo was enough to trigger the goal's execution - you
still have to add a <plugin><executions>...<goal> to the pom, and I can
confirm that this works fine.

Many thanks to Brett for asistance.

Rob

2009/3/25 Rob Dickens <arctic....@googlemail.com>

> As in a <plugins><plugin><executions><execution> block in the pom.xml
of
> the jar-packaged project?
>
> There isn't one, since the plugin's mojo has a '@phase
prepare-package'.
>
> 2009/3/25 Brett Porter <br...@apache.org>
>
>
>>
>> On 25/03/2009, at 10:07 PM, Rob Dickens wrote:
>>
>>  Do jar-packaged projects now execute the new prepare-package phase?
>>>
>>> Have just tried the new version out, hoping that my project with jar
>>> packaging would execute the new phase, to which one of my plug-in
goals
>>> declares itself as being bound, but it appears not to.
>>>
>>
>> All packaging types will if you properly bind to the phase, but there
is
>> no default binding in any of the mojos yet.
>>
>> How have you constructed your execution block?
>>
>> Cheers,
>> Brett
>>
>> --
>> Brett Porter
>> br...@apache.org
>> http://blogs.exist.com/bporter/
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
>> For additional commands, e-mail: users-h...@maven.apache.org
>>
>>
>



-- 
View this message in context:
http://n2.nabble.com/-ANN--Maven-2.1.0-Released-tp2515975p2575576.html
Sent from the maven users mailing list archive at Nabble.com.


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


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

Reply via email to