【发布时间】:2018-12-24 13:08:56
【问题描述】:
当发生 2 个条件中的任何一个时,我需要跳过执行。
类似这样的:
mvn clean test -DconditionA=false -DconditionB=false
这是我的示例 pom:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>list-dir</id>
<phase>validate</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>ls</executable>
<workingDirectory>.</workingDirectory>
<arguments>
<argument>-ls</argument>
</arguments>
<skip>${conditionA}</skip>
<skip>${conditionB}</skip>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
我想要的是能够跳过此执行,无论条件A 还是条件B 为真。只需第二个跳过即可,因为它会覆盖第一个。
有什么办法可以做到吗?
【问题讨论】:
-
为什么需要这样的设置?你想解决什么样的问题?
标签: java maven skip exec-maven-plugin