我拼命想让 maven 故障安全插件运行我的集成测试。
我已经配置了如下插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<id>failsafe-itest</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<skip>false</skip>
<includes>
<include>**/integration/**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
我在以下软件包中确实有一个集成测试:
com.bignibou.tests.integration.repository.advertisement
但是,mvn-failsafe-plugin不会拾取它。
我的包含语法有什么问题?
改为:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.16</version>
<configuration>
<skip>false</skip>
<includes>
<include>**/integration/**</include>
</includes>
</configuration>
<executions>
<execution>
<id>failsafe-itest</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<skip>false</skip>
<includes>
<include>**/integration/**</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
解决了问题。
但是,我必须使用 mvn failsafe:integration-test
运行插件本身才能仅运行集成测试并缩短单元测试!