1

在这里,我在 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>

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

谢谢你的帮助

4

1 回答 1

1

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

于 2011-10-06T14:46:50.790 回答