【发布时间】:2019-07-17 11:31:05
【问题描述】:
如果一个失败,两个maven插件是否可以执行相同的生命周期?
例子:
假设我有以下插件配置,
<plugins>
<plugin>
<groupId>smothing</groupId>
<artifactId>plugin-1</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>doSomthing</id>
<phase>test</phase>
//...//
</plugin>
<plugin>
<groupId>something</groupId>
<artifactId>plugin-2</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>doSomthingAgain</id>
<phase>test</phase>
//...
</plugin>
</plugins>
即使第一个插件失败,我也想执行 plugin-2 测试阶段。我不想忽略或跳过测试用例。
即使一个失败,我也有以下两个插件在同一阶段执行。
<groupId>com.thoughtworks.gauge.maven</groupId>
<artifactId>gauge-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
基本上,在仪表测试之后,我想通过 maven exec 插件执行一些清理活动。那么我有什么选择总是执行 maven exec 插件吗? (没有命令行参数,这是我在 pom.xml 中所期待的)
我看过这些答案,但都说要跳过测试用例。
How to run a maven goal when there is tests failures?
Maven reporting plugins do not execute if a unit test failure occurs
非常感谢任何帮助:)
【问题讨论】: