On 22-May-09, at 10:46 AM, Stephen Connolly wrote:

OK, I just noticed this...

If I have two mojo's annotated with different phases, i.e.

/**
* @goal integration-test
* @requiresProject true
* @requiresDependencyResolution test
* @phase integration-test
*/
public class FailsafeMojo
   extends AbstractMojo
{
...
}

and

/**
 * @goal verify
 * @requiresProject true
 * @requiresDependencyResolution test
* @phase verify
*/
public class VerifyMojo
   extends AbstractMojo
{
...
}


If I add to my pom.xml

<project>
 ..
 <build>
   ..
   <plugins>
     ...
     <plugin>
       <groupId>....</groupId>
       <artifactId>....</artifactId>
       <version>...</version>
       ...
*        <executions>
         <execution>
           <goals>
             <goal>integration-test</goal>
             <goal>verify</goal>
           </goals>
         </execution>
       </executions>
*      </plugin>
     ...
   </plugins>
   ...
 </build>
</project>

Then the integration-test goal is bound to the integration-test phase and
the verify goal is bound to the verify phase.

My question is this... is this a feature or a bug?

It'd be nice if it was a feature... but I suspect it is a bug...


The mojos are binding to phase declared in the annotations. Why do you think this would be a bug?

Just to confirm for everyone...

If I add

<project>
 ..
 <build>
   ..
   <plugins>
     ...
     <plugin>
       <groupId>....</groupId>
       <artifactId>....</artifactId>
       <version>...</version>
       ...
*        <executions>
         <execution>
           <phase>integration-test</phase>
           <goals>
             <goal>integration-test</goal>
             <goal>verify</goal>
           </goals>
         </execution>
       </executions>
*      </plugin>
     ...
   </plugins>
   ...
 </build>
</project>

Then both goals are bound to the integration-test phase, as I would expect


I think 2.x is a little lax. It should blow up and tell you that you're trying to wire the mojo to a phase not specified in the mojo itself. If it is supposed to flexible wrt where it runs in the lifecycle then no phase should be specified in the mojo. You're doing something the author of the mojo did not intend.

-Stephen

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/SonatypeNexus
http://twitter.com/SonatypeM2E
----------------------------------------------------------

Simplex sigillum veri. (Simplicity is the seal of truth.)


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

Reply via email to