下面的片段是maven-cargo插件配置的摘录,但问题与该特定插件无关。
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
<goal>start</goal>
</goals>
</execution>
</executions>这个配置(简单地称它为插件A)将等待到pre-integration-test阶段,然后启动它的目标deploy和start (按这个顺序)。
假设我有另一个插件B,这是相关的在同一阶段的。我有什么选择
我认为(1)的答案是这里,将目标的顺序与POM中插件定义的顺序联系起来。但我不知道(2)。
发布于 2012-02-22 10:43:38
关于(1)你是对的。如果要在同一阶段执行两个插件,那么它们将按照在pom.xml中声明的顺序执行。
我不能百分之百地肯定(2),但是我认为没有一些黑客是不可能的,例如使用exec-maven-plugin:
<!-- deploy -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- do something -->
<plugin>
<groupId>some_other_plugin</groupId>
<artifactId>some_other_plugin</artifactId>
<executions>
<execution>
<id>someStuff</id>
<phase>pre-integration-test</phase>
<goals>
<goal>some_goal</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- start -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<commandlineArgs>org.codehaus.cargo:cargo-maven2-plugin:start -Dparam=value</commandlineArgs>
</configuration>
</execution>
</executions>
</plugin>https://stackoverflow.com/questions/9391996
复制相似问题