【发布时间】:2015-09-21 08:06:46
【问题描述】:
- 是否可以通过命令行将可选参数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 没有提到用户属性
测试包括:
编译器的包含过滤器列表。
类型:java.util.Set
自:2.0
必填:否
测试不包括:
编译器的排除过滤器列表。
类型: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>
【问题讨论】:
标签: java maven maven-3 maven-compiler-plugin