Tuesday, June 1, 2010

ANT Exec task - Open New Command Prompt

How to Open New Command Prompt Using ANT task. ??

Currently we were working on ANT script to run the Selenium Test. And we think it would be nice if ANT script also starts the web server before executing test cases.

To start the web application we require to fire a command from command prompt. we used the Exec task task and it was working fine but problem was it was logging on the same command prompt from which we have run ANT task. We require to open the new command prompt for that.

We tried the cmd /k option but it was not working. Finally we got the solution and it is as below.

 Starting application 

In the script appDir is the Directory path where your server resides.
and grails run-app is the command we need to run the command prompt to launch the web application.