我在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>
我无法想象如果另一个命令失败,如何运行命令。
感谢您的帮助
答案 0 :(得分:1)
这些是Ant任务。它只与Maven有关,因为你正在使用Antrun插件。你应该看看the manual page for the Ant exec task。特别是,您可能会对“resultproperty”属性感兴趣。这将让您捕获流程的退出代码,然后您可以根据它做出决定。