尽管<exclude>
文件中surefire
插件配置下有pom.xml
条条目,哪个maven命令可用于执行所有测试?
例如-以下是pom.xml
中的部分,但我不想排除TestA.java
。可以使用哪个maven命令?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/TestA.java</exclude>
</excludes>
</configuration>
</plugin>
答案 0 :(得分:2)
将配置文件添加到您的pom.xml
<profiles>
<profile>
<id>all-tests</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<excludes>
<exclude></exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
此配置文件覆盖surefire插件的排除部分。 只需通过以下方式激活配置文件:
mvn clean install -Pall-tests