【问题标题】:Maven How to execute another command incase of some other commands failureMaven如何在其他一些命令失败的情况下执行另一个命令
【发布时间】:2011-12-02 05:55:57
【问题描述】:

这里我在 maven 中遇到了类似的问题

.....
<tasks>
    <exec executable="subst" failonerror="false">
        <arg line="f: c:\blabla"/>
    </exec>
////// here the execution I try to make!
    <exec executable="subst" failonerror="false" if=//before execution fails!>
        <arg line="g: c:\blabla"/>
    </exec>
<tasks>

我无法想象在另一个命令失败的情况下如何运行命令。

感谢您的帮助

【问题讨论】:

    标签: windows ant exec-maven-plugin


    【解决方案1】:

    这些是 Ant 任务。它只与 Maven 有任何关系,因为您使用的是 Antrun 插件。你应该看看the manual page for the Ant exec task。特别是,您可能会对“resultproperty”属性感兴趣。这将让您捕获进程的退出代码,然后您可以根据它做出决策。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-28
      • 1970-01-01
      • 1970-01-01
      • 2017-04-14
      • 2012-05-17
      • 1970-01-01
      相关资源
      最近更新 更多