- Download Tomcat Deployer from Apache Site
- Expand Deployer's tar.gz file anywhere you like(call the directory tomcat.deployer.dir)
- Generate build.xml
- Add following element to build.xml
<path id="classpath.tomcat">
<fileset dir="${topmcat.dir}/lib/">
<include name="*.jar" />
</fileset>
</path>
<path id="classpath.tomcat-deployer">
<fileset dir="${tomcat.deployer.dir}">
<include name="*.jar" />
</fileset>
</path>
<taskdef resource="org/apache/catalina/ant/catalina.tasks" classpathref="classpath.tomcat-deployer" />
<target name="deploy">
<undeploy url="${url}" username="${username}" password="${password}" path="${context}" failOnError="false" />
<deploy url="${url}" username="${username}" password="${password}" path="${context}" war="${appName}.war" update="true" />
</target>
<target name="compile" depends="cleanup">
<javac srcdir="${dir.src}" destdir="${dir.classes}" executable="${compiler}" includeantruntime="false">
<classpath refid="classpath.tomcat" />
</javac>
</target>