In general, you can rely on Ant to perform tasks in order. <start> not executed until <stop> .
However, given the nature of Tomcat and what it means to βstop Tomcat,β what StopTask actually does is something like
- Connect to the Tomcat disconnect port and tell Tomcat to gracefully close
- After sending the message, exit
Therefore, you can expect StopTask to complete before Tomcat completes the shutdown process - the task simply tells Tomcat to shut down and not wait for it to close.
You will need a different mechanism in your script to make sure that you are not trying to start the Tomcat instance while another instance on the same port is still in the shutdown phase (for example, sleeping an arbitrary number of seconds).
source share