ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffen Schluff" <>
Subject AW: make ant ignore forked thread
Date Wed, 07 May 2003 08:34:22 GMT
Hello Jens,

there was a posting on this mailing list at the beginning of this year
regarding this problem called "support for detached <exec> on Unix and

You can find it at
otherwise try Google with the term "antrunasync". There is a download on
this page called which includes a script based ant extension
solving this kinds of problems (for certain environments at least). It works
fine for us maybe you want to give it a try.

Here is sample showing how to start Tomcat the comments are german but
you'll probably get the idea anyway :-)

<project name="MyProject" default="main">

	<target name="main" >


		<!-- antRunAsync Binaries muessen in %ANT_HOME%\bin liegen -->
		<property name="antRunAsync" value="C:\Java\ant-1.5.1\bin\antRunAsync"/>
		<property name="exec.dir"
		<property name="exec" value="${exec.dir}\startup.bat"/>

		<!-- Tomcat asynchron starten -->
		<echo message="Starting Tomcat"/>
		<exec executable="${antRunAsync}" dir="${exec.dir}" vmlauncher="false"
			<arg line="${exec}"/>
		<echo message="Tomcat started"/>

		<!-- Ausfuehrung des Buildskripts unterbrechen bis Tomcat gestartet
ist -->
		<!-- Ist Tomcat nicht in einer bestimmten Zeit per http erreichbar, -->
		<!-- wird der Buildvorgang mit einem Fehler abgebrochen -->
		<echo message="Waiting for Tomcat to be up and running"/>
		<waitfor timeoutproperty="tomcat.not.started"
			maxwait="30" maxwaitunit="second"
			checkevery="500" checkeveryunit="millisecond" >
			<http url="http://localhost:8080/index.jsp"/>
		<fail message="Unable to reach Tomcat" if="tomcat.not.started"/>
		<echo message="Tomcat appears to be up and running"/>



Best wishes,

Steffen Schluff
Orientation in Objects GmbH

-----Ursprungliche Nachricht-----
Von: Jens Skripczynski []
Gesendet: Mittwoch, 7. Mai 2003 00:20
Cc: Jens Skripczynski
Betreff: make ant ignore forked thread


I want to write a startup skript for tomcat in ant.

stopping works fine. But when I try to start ant, the
task keeps waiting for the server to shut down.

Is there some hidden option, where I can make ant to ignore
that a specific <java fork=yes> task is not finished ?

I found that I could use exec, but I would have all the OS specific
tasks (setup paths, find executeable java command,...), that ant all
does for me, when using <java>. So as far as I understand <exec>, it is
not an option

I will attach my current start script. I hope someone has a hint.


Jens Skripczynski
E-Mail: skripi-lists(at)myrealbox(dot)com

Wisdom comes with age,
but sometimes age comes alone.

View raw message