当我运行mvn clean install
时,对于integration-test
阶段,它不使用故障安全插件。
但是如果我明确地说要调用插件来运行集成测试,那么它可以正常工作(mvn failsafe:integration-test
)。
在mvn clean install
阶段运行integration-test
时,如何让maven使用failsafe插件?
答案 0 :(得分:11)
To use the Failsafe Plugin, you need to add the following configuration
to your pom.xml
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.11</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
[...]
</project>
这是你要找的吗?