Ant任务使我的服务器和应用程序的启动自动化
问题描述:
我想编写Ant任务来自动执行启动我的服务器的任务,然后使用我的应用程序的URL打开Internet Explorer。Ant任务使我的服务器和应用程序的启动自动化
显然我必须首先执行startServer
任务,然后执行startApplication
任务。
但是即使在启动服务器执行startApplication
任务后,Ant仍然没有出现startServer
任务。
基本上我想让Ant知道startServer
不会结束,ANT必须从startServer
任务和runstartApplication
任务出来,而startServer任务在后台运行。
答
我的猜测是你在startServer
有exec
任务。将spawn="true"
添加到exec
。然后,Ant将在后台执行该命令并继续而不用等待它完成。
答
我同意亚伦你可以使用exec
来做到这一点,你也可以使用waitfor
来测试你的连接。
<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>
答
您还需要了解直接执行.bat文件的问题。有关更多信息,请参阅<exec>任务的手册页。
你可以发布'startServer'任务吗? – 2009-08-11 12:55:44
\t \t \t \t \t \t \t \t \t \t \t \t \t –
2009-08-11 13:06:12