0
我有一個目標,其中執行了多個非戰爭任務。 如果由於缺少archieve文件導致UNWAR任務失敗,我仍然想要在該目標中執行其他(下一個)UNWAr任務。這個怎麼做。如何在UNWAR任務上設置failonerror = false
感謝, 拉吉
我有一個目標,其中執行了多個非戰爭任務。 如果由於缺少archieve文件導致UNWAR任務失敗,我仍然想要在該目標中執行其他(下一個)UNWAr任務。這個怎麼做。如何在UNWAR任務上設置failonerror = false
感謝, 拉吉
第三方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. -->