【发布时间】:2016-08-11 13:48:05
【问题描述】:
目前我的集成测试仅在我运行mvn install 时运行。我想让它们在我做mvn test时运行。
我的<pluginManagement> 部分包含:
<pluginManagement>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18.1</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
...
</pluginManagement>
当我只给出目标test时,如何让集成测试运行?
【问题讨论】:
-
为什么?它们在
integration-test阶段调用,如果需要,您可以调用mvn verify。 -
(修正了这个问题的标题)。我想知道这是否可能。以及如何。
-
我的问题还是一样:为什么您希望在运行
mvn test时调用您的 IT?它们通常在integration-test阶段调用,您通常希望调用mvn verify来运行IT,以便运行post-integration-test阶段中的东西。 -
如果想避免安装但仍执行本地测试,应该养成运行
mvn verify而不是maven test或mvn package的习惯。
标签: maven integration-testing maven-failsafe-plugin