ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pardey, Craig" <CRAIG.PAR...@tdsecurities.com>
Subject Exec JBoss - window not closed on exit
Date Tue, 15 Jun 2004 15:28:54 GMT
Hi,

I am using Ant 1.6.1 with CruiseControl to build, start JBoss, run some acceptance tests,
then shutdown JBoss.

Everything works fine except for one minor annoyance: the DOS window started with JBoss remains
open once JBoss has been shut down.

Is there a way to ensure that the window gets closed?

I have attached the build file below.

Craig

<project name="build-cds" default="build" basedir="checkout/cds">

    <property name="jboss.home" value="/jboss-3.0.6_tomcat-4.1.18"/>
    
    <target name="build">
        <cvs command="up -d -P"/>
        <ant antfile="build.xml" target="clean"/>
        <ant antfile="build.xml" target="main"/>

        <antcall target="start-jboss">
            <param name="script" value="run_junit.bat"/>
        </antcall>
        <ant antfile="build.xml" target="test-ejbs"/>
        <antcall target="stop-jboss"/>
    </target>
    
    <target name="start-jboss">
	<echo message="Starting JBoss"/>
        <exec executable="cmd.exe" dir="${jboss.home}/bin" spawn="true">
            <arg line="/c start ${script}"/>
        </exec>

	<echo message="Waiting for JBoss to start..."/>
	<waitfor maxwait="5" maxwaitunit="minute" checkevery="5" checkeveryunit="second">
	    <and>
		<socket server="localhost" port="8080"/>
		<http url="http://localhost:8080/cds/index.jsp"/>
	    </and>
	</waitfor>
    </target>

    <target name="stop-jboss">
	<echo message="Shutting down JBoss..."/>
        <exec executable="cmd" dir="${jboss.home}/bin" spawn="false">
            <arg line="/c shutdown.bat -u user -p pwd"/>
        </exec>

	<echo message="Waiting for JBoss to stop..."/>
	<waitfor maxwait="5" maxwaitunit="minute" checkevery="5" checkeveryunit="second">
	    <and>
		<not><socket server="localhost" port="8080"/></not>
		<not><http url="http://localhost:8080/cds/index.jsp"/></not>
	    </and>
	</waitfor>
    </target>

</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message