tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael 'Mickey' Sattler" <>
Subject Tomcat + Ant: precompiling servlets & making a WAR file
Date Tue, 19 Jun 2001 17:17:46 GMT
Attached is the Ant build.xml file (very lightly edited from the 
default version). I have been reading posts in both the Tomcat-user 
and Ant-user lists, but I still don't feel that I understand what I 
need to do in order to test the most simple case of (1) using jspc to 
precompile servlets and (2) make a WAR file to drop over at the test 

Would someone please take a wee bit of pity on a guy battling a 
deadline (okay, who isn't? :-) and show me what you've done to get 
this to work.

Many, many thanks.

  == snip ==

<project name="Test Project" default="compile" basedir=".">

   <property name=""       value="testproject"/>
   <property name="tomcat.home" 
   <property name="deploy.home"    value="${tomcat.home}/webapps/${}"/>
   <property name="dist.home"      value="${deploy.home}"/>
   <property name="dist.src"       value="${}.jar"/>
   <property name="dist.war"       value="${}.war"/>
   <property name="javadoc.home"   value="${deploy.home}/javadoc"/>

   <target	name="clean">
     <delete	dir="${deploy.home}"/>

   <target name="prepare">
     <mkdir  dir="${deploy.home}"/>
     <copy	todir="${deploy.home}">
       <fileset dir="web"/>
     <mkdir	dir="${deploy.home}/WEB-INF"/>
     <copy	file="etc/web.xml" tofile="${deploy.home}/WEB-INF/web.xml"/>
     <mkdir  dir="${deploy.home}/WEB-INF/classes"/>
     <mkdir  dir="${javadoc.home}"/>
	<!-- For Ora taglib (from JavaServer Pages book) -->
     <mkdir	dir="${deploy.home}/WEB-INF/tlds"/>
     <copy	todir="${deploy.home}/WEB-INF/lib"><fileset 
     <copy	todir="${deploy.home}/WEB-INF/tlds"><fileset 

   <target name="compile" depends="prepare">
     <javac	srcdir="src" destdir="${deploy.home}/WEB-INF/classes"
			debug="on" optimize="off" deprecation="off"/>
     <copy	todir="${deploy.home}/WEB-INF/classes">
       <fileset dir="src" includes="**/*.properties"/>

   <target name="javadoc" depends="prepare">
     <javadoc sourcepath="src" packagenames="*"

   <target name="all" depends="clean,prepare,compile,javadoc"/>

   <target name="dist" depends="prepare,compile">
     <jar jarfile="${dist.home}/${dist.src}"
          basedir="." includes="*"/>
     <jar jarfile="${dist.home}/${dist.war}"
          basedir="${deploy.home}" includes="*"/>

Michael "Mickey" Sattler, Geek Times   <>
San Francisco, California, USA    <>

I was born not knowing and have had only a little time to change that here
and there. -- Richard Feynman (1918 - 1988)

View raw message