This is a feature. If no phase definition is provided for an execution, then each mojo is bound to the phase declared in the @phase annotation, if one is declared.

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...

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

-Stephen


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

Reply via email to