tags:

views:

509

answers:

4

Hello!

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.

Please let me know how can I achieve the same.

Thank you Chaitanya

+1  A: 

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.

Aaron Digulla
+2  A: 

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>
John McG
A: 

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.

A: 

spawn is not helping. The server is not even starting. I got to know about parallel ant task. But that ain't work :(

Chaitanya MSV