我们为maven中的集成测试阶段生命周期定义了数百个测试,并且需要很长时间才能完成。如何在maven中的集成测试目标中运行单个测试
我想要做的只是在integration-test
中运行一个测试。我试过了:
mvn -Dtest=<my-test> integration-test
但这不起作用。 -Dtest
仅在单元测试目标中运行测试,而不是集成测试阶段。我尝试了-Dintegration-test=<my-test>
,而忽略了这一点。
有没有办法做到这一点?
我的配置是:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>surefire-it</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<excludes>
<exclude>none</exclude>
</excludes>
<includes>
<include>**/api/**</include>
</includes>
.....
我刚刚在我的项目上完成了这项工作,并且工作正常。任何机会你可以发布pom的surefire pluging部分? – 2009-05-21 19:55:08
我不能发布在充分的机会,因为限制。但这是它的要点。 – Jalpesh 2009-05-21 20:22:25