java动态包含和排除MavReplugin
你能告诉我我是否可以动态更改Maven冲浪插件的Include
和Exclude
吗
例如:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<includes>
<include>**/${param}Spec*.*</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
我希望在执行Maven test命令时从命令行传递$param
如果您有解决方案,请给出建议。我试过argline
和systemProperties
谢谢
# 1 楼答案
我不认为有办法传递动态参数,但如果排除/包含的组合有限,可以使用下面的技巧。诀窍是使用具有不同组合的配置文件,如combo1、combo2等。然后您可以使用特定的配置文件运行maven build&;只有那些包含/排除才有效
Command=
mvn clean package -P combo1
波姆。xml