True,
The lifecyclePhase property/getter is not present in the 2.0.X (at least
not until 2.0.8).
You will need to use a Maven dependency of at least 3.0.X for this to work.
2013/12/24 Igor Fedorenko
> This works for me just fine, at least from m2e. Tried Maven 3.0.5 and
> 3.1.1.
>
> @Mojo
This works for me just fine, at least from m2e. Tried Maven 3.0.5 and 3.1.1.
@Mojo(name = "test2", defaultPhase = LifecyclePhase.COMPILE)
public class Test2Mojo extends AbstractMojo {
@Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
private String phase;
pu
Am 2013-12-22 18:40, schrieb Robert Scholte:
Michael,
you're already a team-member, so no need to add yourself as a contributor.
Thanks, I will change the POMs accordingly.
Op Sun, 22 Dec 2013 17:54:40 +0100 schreef :
Author: michaelo
Date: Sun Dec 22 16:54:40 2013
New Revision: 1553003
U
Try just injecting the mojoExecution object.
Then invoke the getLifecyclePhase() method in it.
2013/12/24 Martin Gainty
> Igor/Tamas
> a quick test
>
> package org.apache.maven.plugin;
> public class CompilerMojo extends AbstractCompilerMojo
> {
> @Parameter(defaultValue = "${mojoExecution.
Igor/Tamas
a quick test
package org.apache.maven.plugin;
public class CompilerMojo extends AbstractCompilerMojo
{
@Parameter(defaultValue = "${mojoExecution.lifecyclePhase}")
private String executionPhase;
public String getExecutionPhase() { return executionPhase; }
public void
Here is an example, same as proposed by Igor
https://github.com/sonatype/nexus-maven-plugins/blob/master/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/AbstractStagingMojo.java#L72
Still, you need to be careful if you want maven 2.x, maven 3.0.x and maven
3.1.x compatibility,