You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Tommy Knowlton <To...@KE4KUG.net> on 2007/04/05 20:23:42 UTC

How can I insert a (non-default?) lifecycle phase?

Hello,

I've created a plugin that I'm using to create "installer" type
artifacts. That is, <packaging>installer</packaging> in POM's will use
my plugin's defined lifecycle mapping to build the desired artifact.

Now, I'm trying to get the builder to do some work "just before" the
package phase.

I've tried adding:

<prepare-package>org.apache.maven.plugin:somePlugin:someGoal</prepare-package>

to the <phases /> element inside the component descriptor that sets my
plugin's LifecycleMapping, but it's still never running the
<prepare-package> phase. In the debugger, it appears that the
DefaultLifecycleExecutor's pre-populated lifecycles, in particular the
<id>default</id> lifecycle, lacks this phase.

How can I modify the build lifecycle to do work "just before" the
package phase? Of course, everything works when I bind the desired
goal to the <test/> phase, but the goal I'm binding has nothing to do
with testing: that workaround is a kludge.

Can anybody explain how I can modify the lifecycle to add a "custom"
lifecycle phase? My <packaging /> is only binding a few lifecycle
phases as it is, but none of the existing (default lifecycle) phase
names means the same thing as what I want done.

Thanks,
--
Tommy Knowlton

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


Re: How can I insert a (non-default?) lifecycle phase?

Posted by Wayne Fay <wa...@gmail.com>.
There have been several discussions on this topic on the Maven Dev
list, in particular, I'd suggest you read this thread (on Nabble):

Maven Developers List	
date		Dec 3, 2006 4:28 PM	
subject		[m2] New pre-package phase?

There are over 40 posts in that thread -- I'm sure you can glean some
useful information from it. There are other related threads you will
probably find if you search for "lifecycle" on this list and the Dev
list.

Wayne

On 4/5/07, Tommy Knowlton <To...@ke4kug.net> wrote:
> Hello,
>
> I've created a plugin that I'm using to create "installer" type
> artifacts. That is, <packaging>installer</packaging> in POM's will use
> my plugin's defined lifecycle mapping to build the desired artifact.
>
> Now, I'm trying to get the builder to do some work "just before" the
> package phase.
>
> I've tried adding:
>
> <prepare-package>org.apache.maven.plugin:somePlugin:someGoal</prepare-package>
>
> to the <phases /> element inside the component descriptor that sets my
> plugin's LifecycleMapping, but it's still never running the
> <prepare-package> phase. In the debugger, it appears that the
> DefaultLifecycleExecutor's pre-populated lifecycles, in particular the
> <id>default</id> lifecycle, lacks this phase.
>
> How can I modify the build lifecycle to do work "just before" the
> package phase? Of course, everything works when I bind the desired
> goal to the <test/> phase, but the goal I'm binding has nothing to do
> with testing: that workaround is a kludge.
>
> Can anybody explain how I can modify the lifecycle to add a "custom"
> lifecycle phase? My <packaging /> is only binding a few lifecycle
> phases as it is, but none of the existing (default lifecycle) phase
> names means the same thing as what I want done.
>
> Thanks,
> --
> Tommy Knowlton
>
> ---------------------------------------------------------------------
> 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