Reputation: 6784
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.
Upvotes: 5
Views: 4704
Reputation:
You also need to be aware of the problems with exec'ing .bat files directly. Consult the manual page for the <exec> task for more information.
Upvotes: 0
Reputation: 698
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>
Upvotes: 2
Reputation: 328594
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.
Upvotes: 3