在集成测试阶段允许maven exec使构建失败

时间:2013-10-07 11:07:01

标签: java maven testing exec

我的pom.xml上有以下内容:

<plugin>
 <groupId>org.codehaus.mojo</groupId>
 <artifactId>exec-maven-plugin</artifactId>
 <executions>
  <execution>
   <phase>integration-test</phase>
   <goals>
    <goal>java</goal>
   </goals>
  </execution>
 </executions>
 <configuration>
  <mainClass>com.example.StartTestMain</mainClass>
  <arguments>
   <argument>target/classes/local.testrun</argument>
  </arguments>
 </configuration>
</plugin>

虽然它没有问题地执行,但我发现返回代码被忽略,并且StartTestMain无法告诉构建它应该失败。

我正在考虑传播一个Exception,希望maven能够接受它并停止构建。但是,如果在forkMode中配置了exec-maven-plugin,则会失败。

任何清洁选项?

0 个答案:

没有答案
相关问题