jan*_*oth 12 maven-plugin maven
以下代码段是maven-cargo插件配置的摘录,但问题与该特定插件无关.
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
<goal>start</goal>
</goals>
</execution>
</executions>
Run Code Online (Sandbox Code Playgroud)
这个配置(简单地称之为插件A)将等到pre-integration-test阶段,然后触发其目标deploy并start(按此顺序).
假设我有另一个插件B,它在同一阶段相关.我有什么选择
我认为(1)的答案就在这里,将目标的顺序与POM中插件定义的顺序联系起来.但我不知道(2).
And*_*nov 11
你是对的(1).如果要在同一阶段执行两个插件,那么它们将按照在pom.xml中声明的顺序执行.
我不是100%肯定(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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8562 次 |
| 最近记录: |