我在使用 maven 故障安全插件运行集成测试时遇到了问题。我有两个类,一个是 TestUnitTest.java,另一个是 TestIntegrationIT.java。在 pom.xml 中,我配置如下:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*IT.java</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>unit-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
</plugin>
当我运行 mvn:integration-test 时,将执行两个测试,当我运行 mvn failsafe:integration-test 时,只运行“TestIntegrationIT”。为什么输出不同的结果?