我遇到了一個問題,當我使用maven failsafe插件來運行集成測試。 我有兩個類,一個是TestUnitTest.java,另一個是TestIntegrationIT.java。 在pom.xml中,我配置如下:mvn集成測試vs mvn failsafe:集成測試
<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運行:集成測試,將執行兩項測試,當我運行mvn故障安全:集成測試則只能運行「TestIntegrationIT」。爲什麼輸出不同的結果?
你能顯示輸出日誌嗎? – khmarbaise