You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Guillaume Duchesneau <gd...@taleo.com> on 2007/03/01 15:08:56 UTC

[m2] mojo parameter: ${project} vs. ${executedProject}

Hi,

 

I am currently developing some mojos to improve our build and I am a
little bit confused between two parameters that can be set in a mojo:

 

-          ${executedProject}

-          ${project}

 

What is the difference between them?  I have read that the executed
project has something to do with forked lifecycles but I do not fully
understand when I should use one and when I should use the other.

 

For example, if my mojo forks the lifecycle (using @execute annotation),
should I always use ${executedProject} to retrieve project information
from that mojo?  Or if my mojo is bound to a lifecycle phase (no
forking), should I always use ${project} to retrieve/set project
information?

 

Can anybody help?

 

Thanks in advance

 

Guillaume

 


Re: [m2] mojo parameter: ${project} vs. ${executedProject}

Posted by Barrie Treloar <ba...@gmail.com>.
On Fri, Mar 2, 2007 at 12:38 AM, Guillaume Duchesneau
<gd...@taleo.com> wrote:
> I am currently developing some mojos to improve our build and I am a
> little bit confused between two parameters that can be set in a mojo:
> -          ${executedProject}
> -          ${project}
> What is the difference between them?  I have read that the executed
> project has something to do with forked lifecycles but I do not fully
> understand when I should use one and when I should use the other.
>
>
>
> For example, if my mojo forks the lifecycle (using @execute annotation),
> should I always use ${executedProject} to retrieve project information
> from that mojo?  Or if my mojo is bound to a lifecycle phase (no
> forking), should I always use ${project} to retrieve/set project
> information?

Besides the cross-posting, I dont see a response to this email.

But the example you have about looks correct.

If you defined your mojo with @execute then use ${executedProject} to
see the results of that mojo.

Otherwise just stick with ${project}.

If your mojo needs to provide something to the rest of the maven run
then you need to copy out the values from ${executedProject} and put
them into ${project}.

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