如何在UNWAR任务上设置failonerror = false

时间:2014-04-02 09:28:48

标签: ant

我有一个目标,可以执行多个unwar任务。 如果UNWAR任务因缺少archieve文件而失败,我仍然希望在该目标中执行其他(下一个)UNWAr任务。怎么做。

谢谢, 拉吉

1 个答案:

答案 0 :(得分:0)

第三方Ant-Contrib<trycatch> task捕获异常,然后继续使用Ant脚本:

<taskdef resource="net/sf/antcontrib/antlib.xml" />

<trycatch>
    <try>
        <unwar/> <!-- A fully configured unwar task here -->
    </try>
    <catch>
        <echo>The unwar task failed.</echo>
    </catch>
</trycatch>

<!-- The script continues here, even if the unwar task failed. -->
相关问题