ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tharp, Joshua L, SOLGV" <>
Subject RE: make ant ignore forked thread
Date Wed, 07 May 2003 14:26:56 GMT
I haven't tried this, but...

Can you <exec> another ANT that does the <java> for Tomcat? Exec'ing ANT
ought to be easier than exec'ing Tomcat, and you could still use ANT's
features to establish your classpath... I realize it is still an exec,
but it might be worth a try.


-----Original Message-----
From: Jens Skripczynski [] 
Sent: Wednesday, May 07, 2003 3:49 AM
To: Steffen Schluff
Subject: Re: make ant ignore forked thread

Hi Steffen,

I wanted to run tomcat just using the <java> task, as the exec task
limits me to the os specific commands (for tomcat startup.(bat|sh)).

But actually I can specify everything comcat needs inside one <java>
(with classpath, properties...), thus using ants ability to hide the OS
the script (i'm lazy).

So it seems, that currently the <java> task does not support to detach
(?) a
thread | forked jvm, it has started ?

To me it seems a great feature, having a single startup ant-script for a
based server. 

Is it possible to add an additional tag to the <java> task like
'daemon="yes"' needing 'fork="yes"'. Ant is supposed to start the jvm
'forget' about it.

Steffen Schluff:
> 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
> Windows".
> You can find it at
> otherwise try Google with the term "antrunasync". There is a download
> this page called which includes a script based ant
> solving this kinds of problems (for certain environments at least). It
> 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" >
> 		<tstamp/>
> 		<!-- antRunAsync Binaries muessen in %ANT_HOME%\bin
liegen -->
> 		<property name="antRunAsync"
> 		<property name="exec.dir"
> value="C:\Steffen\temp\Tomcat-4.1.12-LE-jdk14\bin"/>
> 		<property name="exec" value="${exec.dir}\startup.bat"/>
> 		<!-- Tomcat asynchron starten -->
> 		<echo message="Starting Tomcat"/>
> 		<exec executable="${antRunAsync}" dir="${exec.dir}"
> failonerror="true">
> 			<arg line="${exec}"/>
> 		</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
> 		<waitfor timeoutproperty="tomcat.not.started"
> 			maxwait="30" maxwaitunit="second"
> 			checkevery="500" checkeveryunit="millisecond" >
> 			<http url="http://localhost:8080/index.jsp"/>
> 		</waitfor>
> 		<fail message="Unable to reach Tomcat"
> 		<echo message="Tomcat appears to be up and running"/>
> 	</target>
> </project>

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

In this world there are only two tragedies; one is not getting
what one wants, the other is getting it.
                                  -- Oscar Wild

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message