<exclude> 根据 surefire 中的插件配置 pom.xml 文件
<exclude>
surefire
pom.xml
例如-以下是来自 但我不想排除在外 TestA.java . 可以使用哪个maven命令?
TestA.java
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <excludes> <exclude>**/TestA.java</exclude> </excludes> </configuration> </plugin>
<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