Continue executing ant script if one task fails

后端 未结 3 1064
一个人的身影
一个人的身影 2021-01-19 10:00

I have an Ant script which runs tests then deploys my application to a QA server. To deploy the application it first calls sun-appserv undeploy, for various rea

3条回答
  •  难免孤独
    2021-01-19 10:11

    I was looking for something similar to this and found an alternative method that is useful if you want to run a lot of tasks that have no dependency on each other and you want to know if all 5 of them fail without having to fix the first one.

    Enclose all the tasks in a parallel task with threadCount set to 1. It's definitely a mis-use of the parallel task but accomplishes my goal:

    
        
        
        
        
    
    

    Running this in a target gives this for output:

    test:
         [echo] Success
    
    BUILD FAILED
    C:\test\build.xml:5:
    fail 1
    fail 2
    fail 3
    
    Total time: 0 seconds
    

提交回复
热议问题