+++ /dev/null
-<project name="Generic Webapp" default="compile" basedir=".">
-
- <!--
- This is a generic build.xml file for Ant that can be used to develop
- any web application that conforms to the following requirements:
-
- - Web sources appear in the directory specified by the "webapp.web"
- property, in exactly the hierarchy to be present in the created
- web application archive.
-
- - Java sources (if any) appear in the directory specified by the
- "webapp.src" property, which will be compiled into the
- "WEB-INF/classes" directory of the resulting web application.
-
- - You must specify a "servlet.jar" property that defines the path
- of the servlet API classes you will compile against.
-
- - If you want to copy Struts libraries and TLD files to your web
- application, set the "struts.libs" property to the pathname of a
- directory containing struts.jar and the associated *.tld files.
-
- - If you want to copy additional JAR files into the WEB-INF/lib
- directory of your web app, set the "webapp.libs" property to the
- pathname of a directory containing the JAR files to be copied.
-
- -->
-
-
- <!-- ========== Prerequisite Properties =================================== -->
-
- <!--
- These properties MUST be set on the "ant" command line, the "antrc"
- properties file in your home directory, or from settings in a superior
- build.xml script, if you wish to take advantage of the corresponding
- functionality.
-
- compile.classpath The class path containing external
- JAR files and directories required for
- compiling this web application. Note
- that struts.jar will automatically be
- added if "struts.lib" is defined, and
- dependent JAR files will be added if
- "webapp.libs" is defined.
-
- build.home Base directory into which we are building
- the Struts components.
-
- commons-beanutils.jar (required). The path to the JAR file
- of the Jakarta Commons Beanutils
- package (version 1.0 or later).
-
- commons-collections.jar (required). The path to the JAR file
- of the Jakarta Commons Collections
- package (version 1.0 or later).
-
- commons-digester.jar (required). The path to the JAR file
- of the Jakarta Commons Digester
- package (version 1.0 or later).
-
- commons-logging.jar (required). The path to the JAR file
- of the Jakarta Commons Logging
- package (version 1.0 or later).
-
- servlet.jar MUST be set to the pathname of the
- servlet API classes you wish to
- compile against.
-
- securityfilter.libs If specified, must be the pathname of a
- directory from which "securityfilter.jar"
- will be copied to your WEB-INF/lib
- directory. Also, the securityfilter.jar
- file will automatically be added to your
- compile classpath.
-
- webapp.libs If specified, must be the pathname of a
- directory from which all available
- "*.jar" files are copied to the web
- application's WEB-INF/lib directory.
- Also, any JAR files found here will
- automatically be added to your compile
- classpath.
-
- webapp.name MUST be set to the base name of the web
- application archive file that will be
- created for this web application.
-
- webapp.suppress Set this property to an arbitrary value
- (such as "true") if you do NOT want the
- source code for your web application
- copied to the WEB-INF/src directory.
-
- webapp.war If specified, overrides the default name
- of the web application archive file to be
- created for this webapp. Default value
- is "${webapp.name}.war".
-
- -->
-
- <!-- property name="build.home" value="target" / -->
- <!-- property name="servlet.jar" value="../jakarta-servletapi/lib/servlet.jar"/ -->
-
-
-
- <!-- ========== Initialization Properties ================================= -->
-
-
- <!--
- These property values may optionally be overridden with property
- settings from an "ant" command line, the "antrc" properties file
- in your home directory, or from settings in a superior build.xml
- script.
- -->
-
-
-
- <!-- Should Java compilations set the debug compiler option? -->
- <property name="compile.debug" value="true"/>
-
- <!-- Should Java compilations set the deprecation compiler option? -->
- <property name="compile.deprecation" value="false"/>
-
- <!-- Should Java compilations set the optimize compiler option? -->
- <property name="compile.optimize" value="true"/>
-
- <!-- The base directory for distribution targets -->
- <property name="dist.home" value="dist"/>
-
- <!-- The source directory for Java compilations related to this webapp -->
- <property name="webapp.src" value="src/${webapp.name}"/>
-
- <!-- The version number of this particular web application -->
- <property name="webapp.version" value="1.0"/>
-
- <!-- The name of the web application archive file to be produced -->
- <property name="webapp.war" value="${webapp.name}.war"/>
-
- <!-- The source directory for copying static web resources and files -->
- <property name="webapp.web" value="web/${webapp.name}"/>
-
-
- <!-- ========== Derived Properties ======================================== -->
-
-
- <!--
- These property values are derived from values defined above, and
- generally should NOT be overridden by command line settings
- -->
-
- <!-- The target directory for building the packed web application -->
- <property name="webapp.dist" value="${dist.home}/webapps"/>
-
- <!-- The target directory for building the unpacked web application -->
- <property name="webapp.target" value="${build.home}/${webapp.name}"/>
-
- <!-- The class path used for compiling this library -->
- <path id="classpath">
- <pathelement location="${catalina.jar}"/>
- <pathelement location="${commons-beanutils.jar}"/>
- <pathelement location="${commons-collections.jar}"/>
- <pathelement location="${commons-digester.jar}"/>
- <pathelement location="${commons-logging.jar}"/>
- <pathelement location="${servlet.jar}"/>
- <pathelement location="${securityfilter.libs}/securityfilter.jar"/>
- <pathelement location="${webapp.libs}"/>
- <pathelement path="${compile.classpath}"/>
- </path>
-
-
- <!-- ========== Executable Targets ======================================== -->
-
-
- <!--
- The "init" target evaluates "available" expressions as necessary
- to modify the behavior of this script.
- -->
- <target name="init">
-
- <echo message="Processing webapp ${webapp.name}"/>
-
- <!-- Do we need to copy dependent libraries? -->
- <available property="copy.libs" file="${webapp.libs}"/>
-
- <!-- Do we need to compile the Java sources for this web application? -->
- <available property="webapp.compile" file="${webapp.src}"/>
-
- <!-- Should we copy Security Filter library files? -->
- <available property="webapp.securityfilter" file="${securityfilter.libs}"/>
-
- </target>
-
-
- <!--
- The "prepare" target creates a directory structure in the build target
- area for the unpacked files associated with this web application
- -->
- <target name="prepare" depends="init"
- description="Prepare target directory">
- <echo message="Processing webapp ${webapp.name}"/>
- <mkdir dir="${webapp.target}"/>
- <mkdir dir="${webapp.target}/WEB-INF"/>
- <mkdir dir="${webapp.target}/WEB-INF/classes"/>
- </target>
-
-
- <!--
- The "libs" target copies specified library JAR files (if any) from the
- "${webapp.libs} directory into the WEB-INF/lib directory of this app.
- -->
-
- <target name="libs" depends="prepare" if="copy.libs"
- description="Copy dependent libraries">
- <echo message="Processing webapp ${webapp.name}"/>
- <mkdir dir="${webapp.target}/WEB-INF/lib"/>
- <copy todir="${webapp.target}/WEB-INF/lib">
- <fileset dir="${webapp.libs}" includes="*.jar"/>
- </copy>
- </target>
-
-
- <!--
- The "source" target copies the Java source code of your web application
- into the build target area, IF AND ONLY IF the "webapp.source"
- property has been set to an arbitrary value.
- -->
-
- <target name="source" depends="prepare" if="webapp.compile"
- unless="webapp.suppress"
- description="Copy Java sources">
- <echo message="Processing webapp ${webapp.name}"/>
- <mkdir dir="${webapp.target}/WEB-INF/src"/>
- <copy todir="${webapp.target}/WEB-INF/src">
- <fileset dir="${webapp.src}"/>
- </copy>
- </target>
-
-
- <!--
- The "securityfilter" target copies the Security Filter library JAR file
- into the build target area.
- -->
- <target name="securityfilter" depends="prepare" if="webapp.securityfilter"
- description="Copy Security Filter library files">
- <echo message="Processing webapp ${webapp.name}"/>
- <mkdir dir="${webapp.target}/WEB-INF/lib"/>
- <copy todir="${webapp.target}/WEB-INF/lib">
- <fileset dir="${securityfilter.libs}" includes="commons-*.jar"/>
- <fileset dir="${securityfilter.libs}" includes="jakarta-oro.jar"/>
- <fileset dir="${securityfilter.libs}" includes="catalina-base64.jar"/>
- <fileset dir="${securityfilter.libs}" includes="securityfilter.jar"/>
- </copy>
- </target>
-
-
- <!--
- The "static" target copies the static web resources portion of your
- web application source into the build target area.
- -->
- <target name="static" depends="prepare,source,libs,securityfilter"
- description="Copy static files">
- <echo message="Processing webapp ${webapp.name}"/>
- <copy todir="${webapp.target}">
- <fileset dir="${webapp.web}"/>
- </copy>
- </target>
-
-
- <!--
- The "compile" target compiles the Java source code of your web
- application, if and only if the specified source directory
- actually exists.
- -->
- <target name="compile" depends="static" if="webapp.compile"
- description="Compile Java sources">
- <echo message="Processing webapp ${webapp.name}"/>
- <javac srcdir="${webapp.src}"
- destdir="${webapp.target}/WEB-INF/classes"
- debug="${compile.debug}"
- deprecation="${compile.deprecation}"
- optimize="${compile.optimize}">
- <classpath refid="classpath"/>
- </javac>
- <copy todir="${webapp.target}/WEB-INF/classes">
- <fileset dir="${webapp.src}">
- <exclude name="**/*.java"/>
- </fileset>
- </copy>
- </target>
-
-
-
- <!--
- The "dist" target creates a web application archive containing
- your completed web application, suitable for deployment on any
- compatible servlet container.
- -->
- <target name="dist" depends="compile"
- description="Create web application archive">
- <echo message="Processing webapp ${webapp.name}"/>
- <jar jarfile="${webapp.dist}/${webapp.war}"
- basedir="${webapp.target}"/>
- </target>
-
-
- <!--
- The "clean" task deletes any created directories that have resulted
- from running any of the other targets in this script.
- -->
-
- <target name="clean"
- description="Clean build and distribution directories">
- <echo message="Processing webapp ${webapp.name}"/>
- <delete dir="${webapp.target}"/>
- <delete file="${webapp.dist}/${webapp.war}"/>
- </target>
-
-
-</project>
-<project name="Security Filter Web Applications" default="compile" basedir=".">
+<?xml version="1.0"?>
+<!--
+$Id: build-webapps.xml,v 1.4 2003/05/05 11:38:27 maxcooper Exp $
+$Revision: 1.4 $
+$Date: 2003/05/05 11:38:27 $
+-->
- <!--
- This is a build file that creates all of the web applications included
- in a Security Filter distribution, using the generic "build-webapp.xml"
- script for the details
- -->
+<!DOCTYPE project [
+ <!ENTITY properties SYSTEM "file:./properties.xml">
+]>
+<project name="securityfilter-webapps" default="build">
- <!-- ========== Prerequisite Properties =================================== -->
+ <!-- import common properties -->
+ &properties;
+ <!-- import ant-contrib tasks -->
+ <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${ant-contrib.jar}"/>
- <!--
- These properties MUST be set on the "ant" command line, the "antrc"
- properties file in your home directory, or from settings in a superior
- build.xml script.
+ <!-- ========== common web app stuff ============================================================================ -->
- build.home Base directory into which we are building
- the Security Filter components.
+ <path id="webapp.classpath">
+ <path refid="compile.classpath"/>
+ <pathelement location="${build.lib.dir}/${project.name}.jar"/>
+ </path>
- compile.classpath If specified, contains a set of JAR files
- and/or directories to be added to the
- compilation classpath.
+ <!-- all webapps use these libs -->
+ <patternset id="common.lib.files">
+ <include name="${project.name}.jar"/>
+ <include name="commons-beanutils.jar"/>
+ <include name="commons-collections.jar"/>
+ <include name="commons-digester.jar"/>
+ <include name="commons-logging.jar"/>
+ <include name="jakarta-oro.jar"/>
+ </patternset>
- servlet.jar The pathname of the servlet API classes
- that you wish to compile against.
+ <!-- ========== blank web app =================================================================================== -->
- securityfilter.libs The directory containing
- securityfilter.jar file.
+ <fileset id="blank.lib.files" dir="${build.lib.dir}">
+ <patternset refid="common.lib.files"/>
+ <include name="catalina-base64.jar"/>
+ </fileset>
- webapp.libs If specified, must be the pathname of a
- directory from which all available
- "*.jar" files are copied to the web
- application's WEB-INF/lib directory.
- -->
+ <path id="blank.static.path" location="${web.dir}/blank"/>
- <!-- property name="build.home" value="${basedir}/target"/ -->
- <property name="securityfilter.libs" value="${build.home}/library"/>
+ <!-- ========== example web app ================================================================================= -->
+ <path id="example.src.path" path="${src.dir}/example"/>
+ <fileset id="example.lib.files" dir="${build.lib.dir}">
+ <patternset refid="common.lib.files"/>
+ <include name="catalina-base64.jar"/>
+ </fileset>
- <!-- ========== Initialization Properties ================================= -->
+ <path id="example.static.path">
+ <pathelement location="${web.dir}/share"/>
+ <pathelement location="${web.dir}/example"/>
+ </path>
+ <!-- ========== catalina web app ================================================================================ -->
- <!--
- These property values may optionally be overridden with property
- settings from an "ant" command line, the "antrc" properties file
- in your home directory, or from settings in a superior build.xml
- script.
- -->
+ <path id="catalina.src.path" path="${src.dir}/catalina-example"/>
- <!-- Should Java compilations set the debug compiler option?
- <property name="compile.debug" value="true"/>
- -->
- <!-- Should Java compilations set the deprecation compiler option?
- <property name="compile.deprecation" value="false"/>
- -->
- <!-- Should Java compilations set the optimize compiler option?
- <property name="compile.optimize" value="true"/>
- -->
- <!-- The base directory for distribution targets
- <property name="dist.home" value="${basedir}/dist"/>
- -->
- <!-- The directory into which the Security Filter JAR files have been created
- <property name="securityfilter.home" value="${build.home}/library"/>
- -->
- <!-- Directory where core securityfilter library configurations files are stored
- <property name="conf.share.dir" value="${basedir}/conf/share"/>
- -->
- <!-- ========== Executable Targets ======================================== -->
+ <fileset id="catalina.lib.files" dir="${build.lib.dir}">
+ <patternset refid="common.lib.files"/>
+ <include name="catalina.jar"/>
+ </fileset>
+ <path id="catalina.static.path">
+ <pathelement location="${web.dir}/share"/>
+ <pathelement location="${web.dir}/catalina-example"/>
+ </path>
- <!--
- The "static.generic" target causes the "static" target of each
- individual web application to be executed.
- -->
- <target name="static.generic">
- <ant antfile="build-webapp.xml" target="static">
- <property name="webapp.name" value="blank"/>
- </ant>
- <ant antfile="build-webapp.xml" target="static">
- <property name="webapp.name" value="example"/>
- </ant>
- <ant antfile="build-webapp.xml" target="static">
- <property name="webapp.name" value="catalina-example"/>
- </ant>
- </target>
-
+ <!-- ========== main targets ==================================================================================== -->
- <!--
- The "static" target causes non-generic static activity required
- for specific tag libraries to be executed.
- -->
- <target name="static" depends="static.generic"
- description="Copy static resources for individual web applications">
- <!-- Copy shared web content for the Security Filter example application -->
- <copy todir="${build.home}/example">
- <fileset dir="${basedir}/web/share" includes="**/*.jsp"/>
- </copy>
- <copy tofile="${build.home}/example/WEB-INF/web.xml"
- file="${basedir}/web/share/WEB-INF/web.xml"/>
- <!-- Copy shared web content for the Security Filter catalina-example application -->
- <copy todir="${build.home}/catalina-example">
- <fileset dir="${basedir}/web/share" includes="**/*.jsp"/>
- </copy>
- <copy tofile="${build.home}/catalina-example/WEB-INF/web.xml"
- file="${basedir}/web/share/WEB-INF/web.xml"/>
- <!-- Copy catalina.jar the Security Filter catalina-example application -->
- <copy tofile="${build.home}/catalina-example/WEB-INF/lib/catalina.jar"
- file="${catalina.jar}"/>
+ <target name="build">
+ <!-- create expanded war dirs for each webapp -->
+ <antcall target="build-webapp" inheritall="false">
+ <param name="webapp.name" value="blank"/>
+ </antcall>
+ <antcall target="build-webapp" inheritall="false">
+ <param name="webapp.name" value="example"/>
+ </antcall>
+ <antcall target="build-webapp" inheritall="false">
+ <param name="webapp.name" value="catalina"/>
+ </antcall>
</target>
+ <target name="dist">
+ <!-- create war files for each webapp in the dist dir -->
+ <antcall target="webapp-war" inheritall="false">
+ <param name="webapp.name" value="blank"/>
+ </antcall>
+ <antcall target="webapp-war" inheritall="false">
+ <param name="webapp.name" value="example"/>
+ </antcall>
+ <antcall target="webapp-war" inheritall="false">
+ <param name="webapp.name" value="catalina"/>
+ </antcall>
+ </target>
- <!--
- The "compile" target causes the "compile" target of each
- individual web application to be executed.
- -->
- <target name="compile">
- <ant antfile="build-webapp.xml" target="compile">
- <property name="webapp.name" value="blank"/>
+ <target name="deploy">
+ <!-- deploy war files -->
+ <ant antfile="deploy.xml" inheritall="false" target="deploy">
+ <property name="webapp.name" value="${project.name}-blank"/>
</ant>
- <ant antfile="build-webapp.xml" target="compile">
- <property name="webapp.name" value="example"/>
+ <ant antfile="deploy.xml" inheritall="false" target="deploy">
+ <property name="webapp.name" value="${project.name}-example"/>
</ant>
- <ant antfile="build-webapp.xml" target="compile">
- <property name="webapp.name" value="catalina-example"/>
+ <ant antfile="deploy.xml" inheritall="false" target="deploy">
+ <property name="webapp.name" value="${project.name}-catalina"/>
</ant>
</target>
-
- <!--
- The "dist" target causes the "dist" target of each
- individual web application to be executed.
- -->
- <target name="dist">
- <ant antfile="build-webapp.xml" target="dist">
- <property name="webapp.name" value="blank"/>
- <property name="webapp.war" value="securityfilter-blank.war"/>
+ <target name="undeploy">
+ <!-- undeploy webapps -->
+ <ant antfile="deploy.xml" inheritall="false" target="undeploy">
+ <property name="webapp.name" value="${project.name}-blank"/>
</ant>
- <ant antfile="build-webapp.xml" target="dist">
- <property name="webapp.name" value="example"/>
- <property name="webapp.war" value="securityfilter-example.war"/>
+ <ant antfile="deploy.xml" inheritall="false" target="undeploy">
+ <property name="webapp.name" value="${project.name}-example"/>
</ant>
- <ant antfile="build-webapp.xml" target="dist">
- <property name="webapp.name" value="catalina-example"/>
- <property name="webapp.war" value="securityfilter-catalina-example.war"/>
+ <ant antfile="deploy.xml" inheritall="false" target="undeploy">
+ <property name="webapp.name" value="${project.name}-catalina"/>
</ant>
</target>
+ <!-- ========== webapp targets ================================================================================== -->
- <!--
- The "clean.generic" target causes the "clean" target of each
- individual web application to be executed.
- -->
- <target name="clean.generic">
- <ant antfile="build-webapp.xml" target="clean">
- <property name="webapp.name" value="blank"/>
- </ant>
- <ant antfile="build-webapp.xml" target="clean">
- <property name="webapp.name" value="example"/>
- </ant>
- <ant antfile="build-webapp.xml" target="clean">
- <property name="webapp.name" value="catalina-example"/>
- </ant>
+ <target name="build-webapp"
+ depends="webapp-compile,webapp-copy-src,webapp-copy-resources,webapp-copy-static,webapp-lib"/>
+
+ <target name="webapp-init">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <property name="webapp.dir" location="${build.webapps.dir}/${webapp.name}"/>
+ <mkdir dir="${webapp.dir}"/>
+ <property name="webapp.webinf.dir" location="${webapp.dir}/WEB-INF"/>
+ <mkdir dir="${webapp.webinf.dir}"/>
+ </target>
+
+ <target name="webapp-build-init" depends="webapp-init">
+ <!-- check for a source path -->
+ <trycatch>
+ <try>
+ <property name="webapp.compile" refid="${webapp.name}.src.path"/>
+ </try>
+ <catch>
+ <echo>No sources to compile for webapp ${webapp.name}.</echo>
+ </catch>
+ </trycatch>
+ <!-- check for a static files path -->
+ <trycatch>
+ <try>
+ <property name="webapp.copy.static" refid="${webapp.name}.static.path"/>
+ </try>
+ <catch>
+ <echo>No static files to copy for webapp ${webapp.name}.</echo>
+ </catch>
+ </trycatch>
+ <!-- check for lib fileset -->
+ <trycatch>
+ <try>
+ <property name="webapp.copy.lib" refid="${webapp.name}.lib.files"/>
+ </try>
+ <catch>
+ <echo>No library files to copy for webapp ${webapp.name}.</echo>
+ </catch>
+ </trycatch>
</target>
+ <target name="webapp-compile" depends="webapp-build-init" if="webapp.compile">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <property name="webapp.classes.dir" location="${webapp.webinf.dir}/classes"/>
+ <mkdir dir="${webapp.classes.dir}"/>
+ <!-- compile java sources to webapp.classes.dir -->
+ <javac
+ destdir="${webapp.classes.dir}"
+ debug="${compile.debug}"
+ debuglevel="${compile.debuglevel}"
+ deprecation="${compile.deprecation}"
+ optimize="${compile.optimize}">
+ <src refid="${webapp.name}.src.path"/>
+ <classpath refid="webapp.classpath"/>
+ </javac>
+ </target>
- <!--
- The "clean" target causes non-generic clean activity required
- for specific tag libraries to be executed.
- -->
- <target name="clean" depends="clean.generic"
- description="Clean output for individual web applications">
+ <target name="webapp-copy-src" depends="webapp-build-init" if="webapp.compile">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <!-- copy source to src dir -->
+ <property name="webapp.src.dir" location="${webapp.webinf.dir}/src"/>
+ <mkdir dir="${webapp.src.dir}"/>
+ <foreach target="webapp-copy-src-dir" param="webapp.src.dir.element" inheritall="true">
+ <path refid="${webapp.name}.src.path"/>
+ </foreach>
</target>
+ <target name="webapp-copy-src-dir">
+ <copy todir="${webapp.src.dir}">
+ <fileset dir="${webapp.src.dir.element}">
+ <include name="**/*.java"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="webapp-copy-resources" depends="webapp-build-init" if="webapp.compile">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <!-- copy any resource (non-.java) files to webapp.classes.dir -->
+ <property name="webapp.classes.dir" location="${webapp.webinf.dir}/classes"/>
+ <mkdir dir="${webapp.classes.dir}"/>
+ <foreach target="webapp-copy-resources-dir" param="webapp.resources.dir.element" inheritall="true">
+ <path refid="${webapp.name}.src.path"/>
+ </foreach>
+ </target>
+
+ <target name="webapp-copy-resources-dir">
+ <copy todir="${webapp.classes.dir}">
+ <fileset dir="${webapp.resources.dir.element}">
+ <exclude name="**/*.java"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="webapp-copy-static" depends="webapp-build-init" if="webapp.copy.static">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <!-- copy static files for this webapp -->
+ <foreach target="webapp-copy-static-dir" param="webapp.static.dir.element" inheritall="true">
+ <path refid="${webapp.name}.static.path"/>
+ </foreach>
+ </target>
+
+ <target name="webapp-copy-static-dir">
+ <copy todir="${webapp.dir}">
+ <fileset dir="${webapp.static.dir.element}"/>
+ </copy>
+ </target>
+
+ <target name="webapp-lib" depends="webapp-build-init" if="webapp.copy.lib">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <property name="webapp.lib.dir" location="${webapp.webinf.dir}/lib"/>
+ <mkdir dir="${webapp.lib.dir}"/>
+ <!-- copy the lib files for this webapp to webapp.lib.dir -->
+ <copy todir="${webapp.lib.dir}">
+ <fileset refid="${webapp.name}.lib.files"/>
+ </copy>
+ </target>
+
+ <target name="webapp-war" depends="webapp-init">
+ <echo>Processing webapp: ${webapp.name}</echo>
+ <jar basedir="${webapp.dir}" destfile="${dist.webapps.dir}/${project.name}-${webapp.name}.war"/>
+ </target>
</project>
# build.properties.sample
#
# This is an example "build.properties" file, used to customize building
-# Security Filter for your local environment. Make any changes you need, and
-# rename this file to "build.properties" in the same directory that contains
-# the Security Filter "build.xml" file.
+# Security Filter. Copy this file to "build.properties" and make any changes
+# you want to use custom values.
#
-# $Id: build.properties.sample,v 1.3 2003/03/30 10:34:24 maxcooper Exp $
+# $Id: build.properties.sample,v 1.4 2003/05/05 11:38:27 maxcooper Exp $
+# -----------------------------------------------------------------------------
+
+# -----------------------------------------------------------------------------
+# Tomcat deployment settings
+#
+# Set these values for deploying to your Tomcat server for automated
+# deployment and testing of the SecurityFilter web apps. The username
+# must be in the admin group on your server, and the admin app must running.
+#
+# If these values are not set, the default values listed below will be used.
+# -----------------------------------------------------------------------------
+#tomcat.host=localhost
+#tomcat.port=8080
+#tomcat.username=admin
+#tomcat.password=password
+
+# -----------------------------------------------------------------------------
+# Tomcat installation directory (CATALINA_HOME)
+#
+# If you do not wish to set CATALINA_HOME in your environment or on the Ant
+# command line (as env.CATALINA_HOME), you can set env.CATALINA_HOME to
+# point to your Tomcat installation in your build.properties file. This
+# value is required to access the catalina-ant.jar file with the
+# Tomcat-specific Ant deployment tasks. The default behavior is to get the
+# value from the environment, in which case it does not need to be set here.
+# -----------------------------------------------------------------------------
+#env.CATALINA_HOME=/usr/local/jakarta-tomcat-4.1.24-LE-jdk14
+
+# -----------------------------------------------------------------------------
+# External library files
+#
+# These files are all avilable in the securityfilter lib CVS directory, and
+# do not need to be set if you wish to use the default libraries. The build
+# file will automatically set them to the values commented out below, so you
+# do not need to uncomment these values to use the defaults.
+#
+# You can override them to point to external libraries if you would like to
+# use versions that are not available in the lib directory.
# -----------------------------------------------------------------------------
# The catalina JAR file from version 4.0 (or later) of the Jakarta Tomcat
# package.
-catalina.jar=/usr/local/jakarta-tomcat-4.1.24/server/lib/catalina.jar
+#catalina.jar=lib/catalina.jar
# The JAR file containing version 1.0 (or later) of the Beanutils package
# from the Jakarta Commons project.
-commons-beanutils.jar=/usr/local/commons-beanutils-1.6.1/commons-beanutils.jar
+#commons-beanutils.jar=lib/commons-beanutils.jar
# The JAR file containing version 1.0 (or later) of the Collections package
# from the Jakarta Commons project.
-commons-collections.jar=/usr/local/commons-collections-2.1/commons-collections.jar
+#commons-collections.jar=lib/commons-collections.jar
# The JAR file containing version 1.0 (or later) of the Digester package
# from the Jakarta Commons project.
-commons-digester.jar=/usr/local/commons-digester-1.4.1/commons-digester.jar
+#commons-digester.jar=lib/commons-digester.jar
# The JAR file containing version 1.0 (or later) of the Logging package
# from the Jakarta Commons project.
-commons-logging.jar=/usr/local/commons-logging-1.0.2/commons-logging.jar
+#commons-logging.jar=lib/commons-logging.jar
# The JAR file containing version 2.0.6 (or later) of
# the the Jakarta ORO project.
-jakarta-oro.jar=/usr/local/jakarta-oro-2.0.7/jakarta-oro-2.0.7.jar
+#jakarta-oro.jar=lib/jakarta-oro.jar
# The JAR file containing the Servlet API version 2.3 (or later) classes to
# compile against
-servlet.jar=/usr/local/jakarta-servletapi-4/lib/servlet.jar
+#servlet.jar=lib/servlet.jar
-<project name="Security Filter" default="compile.library" basedir=".">
+<?xml version="1.0"?>
- <!--
- Security Filter main build.xml file for building everything related to Security Filter :
- - core Security Filter library
- - documentation
- - Security Filter web apps
- - ...
+<!--
+$Id: build.xml,v 1.17 2003/05/05 11:38:27 maxcooper Exp $
+$Revision: 1.17 $
+$Date: 2003/05/05 11:38:27 $
+-->
- This script will delegate some of it's tasks to the other build*.xml
- scripts (build-webapps.xml, ...)
- -->
+<!DOCTYPE project [
+ <!ENTITY properties SYSTEM "file:./properties.xml">
+]>
+<project name="securityfilter" default="default">
- <!-- ========== Prerequisite Properties =================================== -->
+ <!-- import common properties -->
+ &properties;
- <!--
- These properties MUST be set on the "ant" command line, a
- "build.properties" file in the base directory, or a
- "build.properties" file in your user home directory.
+ <!-- ========== Default Target ================================================================================== -->
- catalina.jar (required). The path to the JAR file
- of the Tomcat
- package (version 4.0 or later).
+ <target name="default" depends="test" description="default, invokes test target"/>
- commons-beanutils.jar (required). The path to the JAR file
- of the Jakarta Commons Beanutils
- package (version 1.0 or later).
+ <!-- ========== Build Targets =================================================================================== -->
- commons-collections.jar (required). The path to the JAR file
- of the Jakarta Commons Collections
- package (version 1.0 or later).
-
- commons-digester.jar (required). The path to the JAR file
- of the Jakarta Commons Digester
- package (version 1.0 or later).
-
- commons-logging.jar (required). The path to the JAR file
- of the Jakarta Commons Logging
- package (version 1.0 or later).
-
- jakarta-oro.jar (required). The path to the JAR file
- of the Jakarta ORO
- package (version 2.0.6 or later).
-
- servlet.jar (required). The path to the Servlet API
- classes to compile against
- (version 2.3 or later).
-
- -->
-
- <!-- Load local and user build preferences -->
- <property file="${user.home}/build.properties"/>
- <property file="build.properties"/>
-
-
- <!-- ========== Initialization Properties ================================= -->
-
-
- <!--
- These property values may optionally be overridden with property
- settings from an "ant" command line, the "build.properties" file
- in this directory, the "build.properties" file in your home
- directory, or from settings in a superior build.xml script.
- -->
-
- <!-- Output directory name for all files generated by the build process -->
- <property name="build.home" location="${basedir}/target"/>
-
- <!-- Should Java compilations set the debug compiler option? -->
- <property name="compile.debug" value="true"/>
-
- <!-- Should Java compilations set the deprecation compiler option? -->
- <property name="compile.deprecation" value="false"/>
-
- <!-- Should Java compilations set the optimize compiler option? -->
- <property name="compile.optimize" value="true"/>
-
- <!-- Name of the core securityfilter library -->
- <property name="app.name" value="securityfilter"/>
-
- <!-- Name of the project -->
- <property name="project.name" value="securityfilter"/>
-
- <!-- Version of the project -->
- <property name="project.version" value="1.1-dev"/>
-
-
- <!-- ========== Derived Properties ======================================== -->
-
-
- <!--
- These property values are derived from values defined above, and
- generally should NOT be overridden by command line settings
- -->
-
- <!-- The base directory for distribution targets -->
- <property name="dist.home" location="${basedir}/dist"/>
-
- <!-- The base directory for release targets -->
- <property name="release.home" location="${basedir}/release"/>
-
- <!-- Source directory -->
- <property name="src.dir" location="${basedir}/src"/>
-
- <!-- Source directory for core securityfilter library -->
- <property name="src.share.dir" location="${src.dir}/share"/>
-
- <!-- Source directory for securityfilter-catalina library -->
- <property name="src.catalina.dir" location="${src.dir}/catalina"/>
-
- <!-- Directory where core struts library configurations files are stored -->
- <property name="conf.share.dir" location="${basedir}/conf/share"/>
-
- <!-- Directory where binary release files are staged -->
- <property name="stage.bin.dir" location="${release.home}/stage/bin"/>
-
- <!-- Directory where library release files are staged -->
- <property name="stage.lib.dir" location="${release.home}/stage/lib"/>
-
- <!-- Directory where source release files are staged -->
- <property name="stage.src.dir" location="${release.home}/stage/src"/>
-
- <!-- Directory where release builds are prepared for upload -->
- <property name="upload.dir" location="${release.home}/upload"/>
-
- <!-- Base file name for upload files -->
- <property name="upload.file.base" value="${project.name}-${project.version}"/>
-
- <!-- Web directory -->
- <property name="web.dir" location="${basedir}/web"/>
-
- <!-- Compilation Classpath -->
- <path id="compile.classpath">
- <pathelement location="${catalina.jar}"/>
- <pathelement location="${commons-beanutils.jar}"/>
- <pathelement location="${commons-collections.jar}"/>
- <pathelement location="${commons-digester.jar}"/>
- <pathelement location="${commons-logging.jar}"/>
- <pathelement location="${jakarta-oro.jar}"/>
- <pathelement location="${servlet.jar}"/>
- </path>
-
-
- <!-- ========== Executable Targets ======================================== -->
-
-
- <!--
- The "init" target evaluates "available" expressions as necessary
- to modify the behavior of this script and print some information on
- screen
- -->
- <target name="init">
+ <target name="build" depends="build-compile,build-library,build-webapps"
+ description="builds core code and webapps">
+ <mkdir dir="${build.dir}"/>
+ </target>
- <echo message="--------- ${project.name} ${project.version} ---------"/>
- <echo message=""/>
+ <target name="build-compile">
+ <mkdir dir="${build.classes.dir}"/>
+ <!-- securityfilter core -->
+ <javac srcdir="${src.share.dir}"
+ destdir="${build.classes.dir}"
+ debug="${compile.debug}"
+ debuglevel="${compile.debuglevel}"
+ optimize="${compile.optimize}"
+ deprecation="${compile.deprecation}">
+ <classpath refid="compile.classpath"/>
+ </javac>
+ <!-- catalina adapter realm -->
+ <javac srcdir="${src.catalina.dir}"
+ destdir="${build.classes.dir}"
+ debug="${compile.debug}"
+ debuglevel="${compile.debuglevel}"
+ optimize="${compile.optimize}"
+ deprecation="${compile.deprecation}">
+ <classpath refid="compile.classpath"/>
+ </javac>
+ </target>
- <echo message="java.class.path = ${java.class.path}"/>
- <echo message="java.home = ${java.home}"/>
- <echo message="user.home = ${user.home}"/>
+ <target name="build-library" depends="build-compile">
+ <mkdir dir="${build.lib.dir}"/>
- </target>
+ <property name="build.classes.meta.dir" location="${build.classes.dir}/META-INF"/>
- <!--
- Create directories and copy files for the core securityfilter library
- -->
- <target name="prepare.library" depends="init">
- <mkdir dir="${build.home}/library/classes/META-INF"/>
- <copy file="LICENSE"
- tofile="${build.home}/library/classes/META-INF/LICENSE"/>
- <copy todir="${build.home}/library/classes/org/securityfilter/resources">
+ <!-- build securityfilter.jar -->
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <!-- copy LICENSE file into classes dir -->
+ <copy file="${basedir}/LICENSE" tofile="${build.classes.meta.dir}/LICENSE"/>
+ <!-- copy MANIFEST.MF file into classes dir, replacing PROJECT.VERSION token -->
+ <copy file="${conf.share.dir}/MANIFEST.MF" tofile="${build.classes.meta.dir}/MANIFEST.MF">
+ <filterset refid="project.filterset"/>
+ </copy>
+ <!-- copy DTD file into classes dir -->
+ <copy todir="${build.classes.dir}/org/securityfilter/resources">
<fileset dir="${conf.share.dir}" includes="**/*.dtd"/>
</copy>
- <copy file="${commons-beanutils.jar}"
- tofile="${build.home}/library/commons-beanutils.jar"/>
- <copy file="${commons-collections.jar}"
- tofile="${build.home}/library/commons-collections.jar"/>
- <copy file="${commons-digester.jar}"
- tofile="${build.home}/library/commons-digester.jar"/>
- <copy file="${commons-logging.jar}"
- tofile="${build.home}/library/commons-logging.jar"/>
- <copy file="${jakarta-oro.jar}"
- tofile="${build.home}/library/jakarta-oro.jar"/>
+ <!-- build jar file -->
+ <jar jarfile="${build.lib.dir}/${project.name}.jar"
+ basedir="${build.classes.dir}"
+ manifest="${build.classes.dir}/META-INF/MANIFEST.MF"
+ includes="**"/>
+
+ <!-- copy core external libraries into build.lib.dir -->
+ <copy file="${commons-beanutils.jar}" tofile="${build.lib.dir}/commons-beanutils.jar"/>
+ <copy file="${commons-collections.jar}" tofile="${build.lib.dir}/commons-collections.jar"/>
+ <copy file="${commons-digester.jar}" tofile="${build.lib.dir}/commons-digester.jar"/>
+ <copy file="${commons-logging.jar}" tofile="${build.lib.dir}/commons-logging.jar"/>
+ <copy file="${jakarta-oro.jar}" tofile="${build.lib.dir}/jakarta-oro.jar"/>
<!-- catalina.jar file is needed for realm classes -->
- <copy file="${catalina.jar}"
- tofile="${build.home}/library/catalina.jar"/>
+ <copy file="${catalina.jar}" tofile="${build.lib.dir}/catalina.jar"/>
<!-- extract Base64 class from the catalina.jar file -->
- <jar destfile="${build.home}/library/catalina-base64.jar">
+ <jar destfile="${build.lib.dir}/catalina-base64.jar">
<zipfileset src="${catalina.jar}">
<patternset>
<include name="org/apache/catalina/util/Base64.class"/>
</jar>
</target>
- <!--
- Prepare static directories for web applications
- -->
- <target name="static.webapps">
- <ant antfile="build-webapps.xml" target="static"/>
+ <target name="build-webapps" depends="build-library">
+ <mkdir dir="${build.webapps.dir}"/>
+ <ant antfile="${basedir}/build-webapps.xml" target="build"/>
</target>
- <!--
- Compile core securityfilter library directory components
- -->
- <target name="compile.library" depends="prepare.library"
- description="Compile Security Filter library files">
- <!-- securityfilter core -->
- <javac srcdir="${src.share.dir}"
- destdir="${build.home}/library/classes"
- debug="${compile.debug}"
- optimize="${compile.optimize}"
- deprecation="${compile.deprecation}">
- <classpath refid="compile.classpath"/>
- </javac>
- <!-- catalina adapter realm -->
- <javac srcdir="${src.catalina.dir}"
- destdir="${build.home}/library/classes"
- debug="${compile.debug}"
- optimize="${compile.optimize}"
- deprecation="${compile.deprecation}">
- <classpath refid="compile.classpath"/>
- </javac>
- <jar jarfile="${build.home}/library/${app.name}.jar"
- manifest="${conf.share.dir}/MANIFEST.MF"
- basedir="${build.home}/library/classes"
- includes="**"/>
+ <!-- ========== Clean Target ==================================================================================== -->
+
+ <target name="clean" description="restores directory structure to pre-build status">
+ <delete dir="${build.dir}"/>
+ <delete dir="${dist.dir}"/>
+ <delete dir="${release.dir}"/>
</target>
- <!--
- Compile code for web applications
- -->
- <target name="compile.webapps" depends="compile.library,static.webapps"
- description="Compile Struts web applications">
- <ant antfile="build-webapps.xml" target="compile"/>
+ <!-- ========== Docs Targets ==================================================================================== -->
+
+ <target name="docs" depends="docs-javadoc"
+ description="builds distributable project documentation">
+ <mkdir dir="${build.docs.dir}"/>
</target>
- <!--
- Create Javadoc documentation
- -->
- <target name="compile.javadoc"
- description="Generate JavaDoc API docs">
- <delete dir="${build.home}/documentation/api"/>
- <mkdir dir="${build.home}/documentation/api"/>
+ <target name="docs-javadoc">
+ <delete dir="${build.docs.api.dir}"/>
+ <mkdir dir="${build.docs.api.dir}"/>
<javadoc
- destdir="${build.home}/documentation/api"
+ destdir="${build.docs.api.dir}"
classpath="${servlet.jar}"
packagenames="org.securityfilter.*"
author="true"
version="true"
windowtitle="Security Filter API Documentation"
doctitle="<h1>Security Filter (Version ${project.version})</h1>"
- bottom="Copyright © 2002 - SecurityFilter.org">
+ bottom="Copyright &#169; 2002, 2003 - SecurityFilter.org">
<sourcepath>
<pathelement location="${src.share.dir}"/>
<pathelement location="${src.catalina.dir}"/>
</javadoc>
</target>
- <!--
- Create directories and copy files for distribution
- -->
- <target name="prepare.dist" depends="init">
- <mkdir dir="${dist.home}"/>
- <mkdir dir="${dist.home}/lib"/>
- <mkdir dir="${dist.home}/webapps"/>
- </target>
+ <!-- ========== Dist Target ===================================================================================== -->
- <!--
- Construct library distributables
- -->
- <target name="dist.library" depends="prepare.dist,compile.library">
- <copy todir="${dist.home}/lib">
- <fileset dir="${build.home}/library" includes="*.jar"/>
+ <target name="dist" depends="build,dist-webapps,docs" description="builds distributable files">
+ <!-- copy documentation text files to dist dir, replacing version token -->
+ <mkdir dir="${dist.dir}"/>
+ <copy todir="${dist.dir}">
+ <fileset dir="${basedir}">
+ <include name="HISTORY"/>
+ <include name="INSTALL"/>
+ <include name="README"/>
+ </fileset>
+ <filterset refid="project.filterset"/>
+ </copy>
+ <!-- copy LICENSE file to dist dir -->
+ <copy file="${basedir}/LICENSE" todir="${dist.dir}"/>
+ <!-- library files -->
+ <mkdir dir="${dist.lib.dir}"/>
+ <copy todir="${dist.lib.dir}">
+ <fileset dir="${build.lib.dir}" includes="*.jar"/>
</copy>
</target>
- <!--
- Construct distributable web applications
- -->
- <target name="dist.webapps" depends="compile.webapps,compile.javadoc">
- <ant antfile="build-webapps.xml" target="dist"/>
+ <target name="dist-webapps" depends="build">
+ <!-- create webapp wars -->
+ <mkdir dir="${dist.webapps.dir}"/>
+ <ant antfile="${basedir}/build-webapps.xml" target="dist"/>
</target>
- <!--
- Copy sources for distribution
- -->
- <target name="dist.source" depends="prepare.dist">
- <copy file="LICENSE" tofile="${dist.home}/LICENSE"/>
- <copy file="README" tofile="${dist.home}/README"/>
- <copy file="INSTALL" tofile="${dist.home}/INSTALL"/>
- <copy file="HISTORY" tofile="${dist.home}/HISTORY"/>
- </target>
+ <!-- ========== Release Target ================================================================================== -->
- <!--
- Construct complete binary distribution
- -->
- <target name="dist" depends="dist.library,dist.webapps,dist.source"
- description="Construct binary distribution"/>
-
- <!--
- Construct complete release distributions
- -->
- <target name="release" depends="clean,dist"
- description="Construct release distribution">
- <mkdir dir="${stage.bin.dir}/${upload.file.base}"/>
- <mkdir dir="${stage.src.dir}/${upload.file.base}-src"/>
- <copy todir="${stage.bin.dir}/${upload.file.base}">
- <fileset dir="${dist.home}"/>
+ <target name="release" depends="clean,dist" description="construct release distribution">
+ <mkdir dir="${release.stage.bin.dir}/${upload.file.base}"/>
+ <mkdir dir="${release.stage.src.dir}/${upload.file.base}-src"/>
+ <copy todir="${release.stage.bin.dir}/${upload.file.base}">
+ <fileset dir="${dist.dir}"/>
+ </copy>
+ <copy todir="${release.stage.src.dir}/${upload.file.base}-src">
+ <fileset dir="${basedir}">
+ <include name="build.properties.sample"/>
+ <include name="*.xml"/>
+ <include name="lib/**"/>
+ <include name="web/**"/>
+ <include name="src/**"/>
+ <include name="doc/**"/>
+ <include name="LICENSE"/>
+ </fileset>
</copy>
- <copy todir="${stage.src.dir}/${upload.file.base}-src">
- <fileset dir=".">
- <exclude name="build.properties"/>
- <exclude name="target/**"/>
- <exclude name="dist/**"/>
- <exclude name="release/**"/>
- <exclude name="*.ipr"/>
- <exclude name=".output/**"/>
+ <copy todir="${release.stage.src.dir}/${upload.file.base}-src">
+ <fileset dir="${basedir}">
+ <include name="conf/**"/>
+ <include name="HISTORY"/>
+ <include name="INSTALL"/>
+ <include name="README"/>
</fileset>
+ <filterset refid="project.filterset"/>
</copy>
- <mkdir dir="${upload.dir}"/>
- <zip zipfile="${upload.dir}/${upload.file.base}.zip"
- basedir="${stage.bin.dir}"/>
- <zip zipfile="${upload.dir}/${upload.file.base}-src.zip"
- basedir="${stage.src.dir}"/>
- <tar tarfile="${upload.dir}/${upload.file.base}.tar"
- basedir="${stage.bin.dir}"
+ <mkdir dir="${release.upload.dir}"/>
+ <zip zipfile="${release.upload.dir}/${upload.file.base}.zip"
+ basedir="${release.stage.bin.dir}"/>
+ <zip zipfile="${release.upload.dir}/${upload.file.base}-src.zip"
+ basedir="${release.stage.src.dir}"/>
+ <tar tarfile="${release.upload.dir}/${upload.file.base}.tar"
+ basedir="${release.stage.bin.dir}"
longfile="gnu"/>
- <tar tarfile="${upload.dir}/${upload.file.base}-src.tar"
- basedir="${stage.src.dir}"
+ <tar tarfile="${release.upload.dir}/${upload.file.base}-src.tar"
+ basedir="${release.stage.src.dir}"
longfile="gnu"/>
- <gzip src="${upload.dir}/${upload.file.base}.tar"
- zipfile="${upload.dir}/${upload.file.base}.tar.gz"/>
- <gzip src="${upload.dir}/${upload.file.base}-src.tar"
- zipfile="${upload.dir}/${upload.file.base}-src.tar.gz"/>
+ <gzip src="${release.upload.dir}/${upload.file.base}.tar"
+ zipfile="${release.upload.dir}/${upload.file.base}.tar.gz"/>
+ <gzip src="${release.upload.dir}/${upload.file.base}-src.tar"
+ zipfile="${release.upload.dir}/${upload.file.base}-src.tar.gz"/>
</target>
+ <!-- ========== Undeploy Target ================================================================================= -->
- <!--
- Clean up build and distribution directories
- -->
- <target name="clean"
- description="Clean build and distribution directories">
- <delete dir="${build.home}"/>
- <delete dir="${dist.home}"/>
- <delete dir="${release.home}"/>
+ <target name="undeploy" description="undeploys webapp(s) from server(s)">
+ <ant antfile="${basedir}/build-webapps.xml" target="undeploy"/>
</target>
- <!--
- All-in-one build target
- -->
- <target name="all" depends="clean,compile.library,compile.webapps"
- description="Clean and build library and web applications"/>
+ <!-- ========== Deploy Target =================================================================================== -->
+
+ <target name="deploy" depends="dist-webapps" description="deploys webapp(s) to server(s)">
+ <ant antfile="${basedir}/build-webapps.xml" target="deploy"/>
+ </target>
+
+ <!-- ========== Test Target ===================================================================================== -->
+
+ <target name="test" depends="deploy" description="tests webapp(s) on server(s)">
+ <echo>No tests yet, but they're coming soon!</echo>
+ </target>
+
+ <!-- ========== All Target ====================================================================================== -->
+
+ <target name="all" depends="test,release" description="build and test everything"/>
</project>
--- /dev/null
+<?xml version="1.0"?>
+
+<!--
+$Id: deploy.xml,v 1.1 2003/05/05 11:38:27 maxcooper Exp $
+$Revision: 1.1 $
+$Date: 2003/05/05 11:38:27 $
+-->
+
+<!DOCTYPE project [
+ <!ENTITY properties SYSTEM "file:./properties.xml">
+]>
+
+<project name="Generic Tomcat Webapp Deployment" default="deploy">
+
+ &properties;
+
+ <target name="deploy">
+ <echo>Deploying ${webapp.name}.war</echo>
+ <antcall target="tomcat-deploy"/>
+ </target>
+
+ <target name="undeploy">
+ <echo>Undeploying ${webapp.name}.war</echo>
+ <antcall target="tomcat-undeploy"/>
+ </target>
+
+ <target name="tomcat-init" if="env.CATALINA_HOME">
+ <!-- Taskdefs for Tomcat (catalina) deployment -->
+ <taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" classpath="${catalina-ant.jar}"/>
+ <taskdef name="remove" classname="org.apache.catalina.ant.RemoveTask" classpath="${catalina-ant.jar}"/>
+
+ <!-- default values for tomcat deployment -->
+ <property name="tomcat.host" value="localhost"/>
+ <property name="tomcat.port" value="8080"/>
+ <property name="tomcat.username" value="admin"/>
+ <property name="tomcat.password" value="password"/>
+
+ <property name="webapp.path" value="/${webapp.name}"/>
+ <property name="tomcat.url" value="http://${tomcat.host}:${tomcat.port}"/>
+ <property name="tomcat.manager.url" value="${tomcat.url}/manager"/>
+ </target>
+
+ <target name="tomcat-deploy" depends="tomcat-init,tomcat-undeploy" if="env.CATALINA_HOME">
+ <echo>Deploying ${webapp.name}.war on Tomcat</echo>
+ <deploy url="${tomcat.manager.url}"
+ username="${tomcat.username}"
+ password="${tomcat.password}"
+ path="${webapp.path}"
+ war="file:///${dist.webapps.dir}/${webapp.name}.war"/>
+ </target>
+
+ <target name="tomcat-undeploy" depends="tomcat-init,tomcat-undeploy-check" if="tomcat.needs.undeploy">
+ <echo>Undeploying ${webapp.name}.war from Tomcat</echo>
+ <remove
+ url="${tomcat.manager.url}"
+ username="${tomcat.username}"
+ password="${tomcat.password}"
+ path="${webapp.path}"/>
+ </target>
+
+ <target name="tomcat-undeploy-check" depends="tomcat-init" if="env.CATALINA_HOME">
+ <condition property="tomcat.needs.undeploy">
+ <http url="${tomcat.url}${webapp.path}"/>
+ </condition>
+ </target>
+
+</project>