You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2003/08/19 15:14:54 UTC
DO NOT REPLY [Bug 22553] New: -
taks: make java return after starting a service thread
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22553>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22553
<java> taks: make java return after starting a service thread
Summary: <java> taks: make java return after starting a service
thread
Product: Ant
Version: unspecified
Platform: All
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Core tasks
AssignedTo: dev@ant.apache.org
ReportedBy: skripi@mail2003.shadowbyte.net
CC: skripi@mail2003.shadowbyte.net
Hi,
(this may be a duplicate Enhancement request, but i was unable to master the
query interface... :().
I was wondering if it would be possible to make the java task return (by some
option e.g. service="true"), if i start a java service thread (e.g. tomcat).
Most of the runtime scripts suplied with tomcat do determin the classpath setup
Variables and start a javacomand with certain argements. I belief all of them
could live inside a single build.xml file.
I tried to acomplish this, which did almost work, but the <java> task never
returned and kept waiting until the server was actually shut down. I belief (!)
it would be easy to add this option to further releases of ant.
--------------- sample build.xml file for tomcat --------------
<project name="tomcat" default="usage" basedir=".">
<description>
Tomcat startup and shut script for ant
</description>
<!--
(c) 2003 Jens Skripczynski
This script must be placed in the root directory of the tomcat
installation. To run this script type 'ant -f tomcat.xml option' where
option can be one of the following value 'start', 'stop' and 'restart'.
-->
<!-- set global properties for this script -->
<!-- assume the file is in the root directory of tomcat -->
<property name="catalina-base" location="."/>
<property name="catalina-home" location="."/>
<property name="catalina-temp" location="./temp"/>
<property name="java.endorsed.dirs" location="common/endorsed"/>
<property name="tomcat-bootstrap"
value="org.apache.catalina.startup.Bootstrap"/>
<path id="tomcat-4.1-cp">
<pathelement path="${java.class.path}"/>
<pathelement path="${JAVA_HOME}/lib/tools.jar"/>
<pathelement path="bin/bootstrap.jar"/>
</path>
<target name="usage"
description="displays script usage" >
<echo> Usage: ant -f tomcat.xml start|stop|restart </echo>
</target>
<target name="tomcat" description="executes tomcat with ${param}" >
<echo> Executing tomcat with: ${param} </echo>
<java fork="yes"
classname="${tomcat-bootstrap}">
<arg value="${param}" />
<sysproperty key="catalina.base" value="${catalina-home}" />
<sysproperty key="catalina.home" value="${catalina-home}" />
<sysproperty key="java.io.tmpdir" value="${catalina-temp}" />
<sysproperty key="java.endorsed.dirs" value="${java.endorsed.dirs}" />
<classpath refid="tomcat-4.1-cp" />
</java>
</target>
<target name="start"
description="starts the tomcat server" >
<antcall target="tomcat">
<param name="param" value="start"/>
</antcall>
<echo> Started tomcat server </echo>
</target>
<target name="stop"
description="starts the tomcat server" >
<antcall target="tomcat">
<param name="param" value="stop"/>
</antcall>
<echo> Stopped tomcat server. </echo>
</target>
<target name="stop"
description="starts the tomcat server" >
<antcall target="tomcat">
<param name="param" value="stop"/>
</antcall>
<echo> Stopped tomcat server. </echo>
</target>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org