Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant task to automate the start of my server and application

Tags:

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.

like image 721
Chaitanya MSV Avatar asked Aug 11 '09 12:08

Chaitanya MSV


2 Answers

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.

like image 95
Aaron Digulla Avatar answered Oct 12 '22 23:10

Aaron Digulla


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>
like image 23
John McG Avatar answered Oct 13 '22 01:10

John McG