maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff MAURY <jeffma...@jeffmaury.com>
Subject Re: Hooking before and after a phase
Date Sat, 09 Jun 2012 11:36:56 GMT
Hello,

there is no way in Maven to insert a Mojo between two Mojo from a
packaging. Each Mojo you add in your POM will be executed after the ones
from the packaging.
If you want to execute your Mojo before any Mojo of the package phase, then
you can bind it to the prepare-package phase.

Jeff


On Fri, Jun 8, 2012 at 11:25 PM, Pascal Rapicault <pascal@rapicault.net>wrote:

> Hi,
>
> I have a situation where I need to execute a mojo just before the
> execution of the mojo bound to the phase. Is there a way to achieve this
> without binding my mojo to the previous phase but to the phase that I'm
> interested in?
>
> For example, the "eclipse-plugin" packaging type has the following phases:
> - […]
> - process-test-resources
> - package (which itself executes 2 mojos)
> - […]
>
> I would like to execute a mojo just before the first mojo of the package
> phase is executed, or even better in between the execution of the two mojos
> executed by the package phase.
>
> I could hook my mojo to the process-test-resources but I feel that this is
> incorrect since the execution of my mojo should only happen if the package
> phase does, otherwise it may screw up following builds.
>
> Thanks.
>
> Pascal
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Jeff MAURY


"Legacy code" often differs from its suggested alternative by actually
working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message