- 是否可以通过命令行将可选参数 testIncludes 或 testExcludes 传递给 Maven 编译插件?
我需要传递一些 .java 作为可选参数。
就像是
mvn clean verify test-compile -DtestIncludes=**/course/MyTest.java,**/course/CompileMeWithMyTest.java,etc
在页面http://maven.apache.org/plugins/maven-compiler-plugin/testCompile-mojo.html testIncludes 和 testExcludes 没有提到用户属性
testIncludes:
编译器的包含过滤器列表。
类型:java.util.Set
自:2.0
要求:否
testExcludes:
编译器的排除过滤器列表。
类型:java.util.Set
自:2.0
要求:否
如果问题 1 没有任何可能的变体。是否可以使用命令行以某种方式在下一个配置文件中设置包含/排除 java 类/文件夹。
<profile> <id>only-necessary-classes</id> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3</version> <configuration> <source>${java-version}</source> <target>${java-version}</target> </configuration> <executions> <execution> <id>default-testCompile</id> <phase>test-compile</phase> <configuration> <testIncludes> <include>**/tests/projectname/course/CheckQuizWithNewAccount.java</include> <include>**/tests/projectname/course/V8GenericTests.java</include> </testIncludes> </configuration> <goals> <goal>testCompile</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile>