I want to write Ant task to automate the task of starting my server and then open Internet Explorer with the URL of my application.
Obviously I have to execute the startServer
task first and then startApplication
task.
But Ant is not coming out of startServer
task even after starting the server to execute startApplication
task.
Basically I want Ant to understand that startServer
will not end and ANT has to come out of startServer
task and runstartApplication
task while startServer task is running in background.
My guess is that you have an exec
task in startServer
. Add spawn="true"
to the exec
. Ant will then execute the command in the background and continue without waiting for it to complete.
I agree with Aaron you can use exec
to do this, you can also use waitfor
to test your connection.
<exec executable="${jboss.startup.bat}" spawn="true"/>
<echo>Waiting to start</echo>
<waitfor maxwait="10" maxwaitunit="second" checkevery="5000">
<!-- try to detect when the server has started -->
<http url="${myurl}" />
</waitfor>
<echo>Started</echo>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With