ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karsten Wutzke <>
Subject Background task to start Tomcat 4.1
Date Wed, 09 Apr 2003 18:34:50 GMT
How do I run a background task to start Tomcat 4.1 in Ant? I want to 
start the server, if it is not running yet. However, the <exec> and 
<java> tasks I tried don't seem to be able to do that. I also tried 
<parallel>, but Ant just seems to hang on that task.

The target I wrote:

<property name="local.bootstrap.class" 

<property name="local.bootstrap.jar.file" 

<path id="local.bootstrap.classpath">
   <pathelement path="${local.bootstrap.jar.file}"/>

<target name="start-local" description="Starts local Tomcat.">
   <!-- server already running? yes:bye, no:startup ... but how? -->
   <java classname="${local.bootstrap.class}" fork="true">
     <classpath refid="local.bootstrap.classpath"/>
     <arg value="start"/>
     <sysproperty key="java.endorsed.dirs" 
     <sysproperty key="catalina.base"      value="${env.CATALINA_HOME}"/>
     <sysproperty key="catalina.home"      value="${env.CATALINA_HOME}"/>
     <sysproperty key="" value="${env.CATALINA_HOME}/temp"/>

I drew the Java system properties from the startup scripts in the Tomcat 
bin directory, especially

The task itself works fine. It starts up the server, however... Ant 
hangs, because the task is not run in the background...

Can it be done, so that the task is spawnes in the background? What 
about the <spawn> task I've heard about? Does it live?


View raw message