<?xml version="1.0" encoding="utf-8"?>
<project name="struts" default="compile_src" basedir=".">
<property environment="env"/>
<property name="deploy_web.dir" value="${env.CATALINA_HOME}/webapps/"/>
<property name="src.dir" value="../struts/src/"/>
<property name="webRoot.dir" value="../struts/webRoot/"/>
<property name="classes.dir" value="${webRoot.dir}/WEB-INF/classes/"/>
<property name="lib.dir" value="${webRoot.dir}/WEB-INF/lib/"/>
<target name="deploy_web" depends="build_base_dir,compile_src">
<!--
<antcall target="clear_dir"/>
<antcall target="build_base_dir"/>
<antcall target="compile_src"/>
-->
</target>
<target name="build_base_dir">
<mkdir dir="${deploy_web.dir}/struts/"/>
<copy todir="${deploy_web.dir}/struts/">
<fileset dir="${webRoot.dir}"/>
</copy>
</target>
<target name="compile_src" depends="build_base_dir">
<javac encoding="utf-8" srcdir="${src.dir}" destdir="${deploy_web.dir}/struts/WEB-INF/classes" classpathref="classpath.web" source="1.5" debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="clear_dir">
<delete dir="${deploy_web.dir}/struts/" quiet="true"/>
</target>
<path id="classpath.web">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
</project>
[quote]http://blog.csdn.net/hamenny/archive/2009/04/02/4044296.aspx[/quote]