ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steffen Schluff" <schl...@oio.de>
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
Windows".

You can find it at
http://www.mail-archive.com/ant-user@jakarta.apache.org/msg23641.html
otherwise try Google with the term "antrunasync". There is a download on
this page called ant_async.zip 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" >

		<tstamp/>

		<!-- antRunAsync Binaries muessen in %ANT_HOME%\bin liegen -->
		<property name="antRunAsync" value="C:\Java\ant-1.5.1\bin\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}" vmlauncher="false"
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 running"/>
		<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" if="tomcat.not.started"/>
		<echo message="Tomcat appears to be up and running"/>

	</target>

</project>

Best wishes,

Steffen Schluff
Orientation in Objects GmbH
http://www.oio.de


-----Ursprungliche Nachricht-----
Von: Jens Skripczynski [mailto:skripi-lists@myrealbox.com]
Gesendet: Mittwoch, 7. Mai 2003 00:20
An: user@ant.apache.org
Cc: Jens Skripczynski
Betreff: make ant ignore forked thread


Hi,

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.

Ciao

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

Wisdom comes with age,
but sometimes age comes alone.



Mime
View raw message