Once I started getting my ant build script to work for both my development and production environment, I started getting some (evil) duplication in it.
build.xml
<?xml version=”1.0″?>
<project name=”some-project” basedir=”.”>
<property name=”dev-deploy.path”
value=”./lib/apache-tomcat-6.0.18/webapps”>
<property name=”prod-deploy.path”
value=”/usr/share/apache-tomcat-6.0.16/webapps”>
<target name=”copy-dev-war”
depends=”build” description=”copy WAR to webapps directory”>
<copy todir=”${dev-deploy.path}” preservelastmodified=”true”>
<fileset dir=”.”>
<include name=”*.war”/>
</fileset>
</copy>
</target>
<target name=”copy-prod-war”
depends=”build” description=” copy WAR to webapps directory “>
<copy todir=”${prod-deploy.path}” preservelastmodified=”true”>
<fileset dir=”.”>
<include name=”*.war”/>
</fileset>
</copy>
</target>
</project>
As you can [...]