【发布时间】:2010-10-28 00:59:27
【问题描述】:
我们在 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 插件部分?
-
org.apache.maven.plugins maven-surefire-plugin surefire-it integration-test test none **/api/** ..... -
由于限制,我无法发布完整的内容。但这就是它的要点。
-
您可以作为问题的一部分发布。如果您删除排除和包含部分会发生什么,只是出于兴趣。除此之外你的配置和我的一样
标签: maven-2 integration-testing maven-surefire-plugin