Using Tomcat 6.0.x with JSF 1.2_x

Here are modified build.xml and build.properties files for Tomcat. You need to set TOMCAT_HOME and JSF_HOME before running the script. (Alternatively, edit build.properties and set tomcat.dir and jsf.dir to the installation directories.)

<project default="install">

   <property environment="env"/>
   <property file="build.properties"/> 
   <property name="appdir" value="${basedir}/${app}"/>
   <basename property="appname" file="${appdir}"/>
   <property name="builddir" value="${appdir}/build"/>
   <property name="warfile" value="${builddir}/${appname}.war"/>
   
   <path id="classpath">
      <pathelement location="${servlet.api.jar}"/>
      <pathelement location="${jsp.api.jar}"/>
      <pathelement location="${el.api.jar}"/>
      <pathelement location="${jsf.api.jar}"/>
      <fileset dir="${appdir}">        
        <include name="web/WEB-INF/**/*.jar"/>
      </fileset>
   </path>
   
   <target name="init">
      <fail unless="app" message="Run ant -Dapp=..."/>
   </target>

   <target name="prepare" depends="init"
         description="Create build directory.">
      <mkdir dir="${builddir}"/>
      <mkdir dir="${builddir}/WEB-INF"/>
      <mkdir dir="${builddir}/WEB-INF/classes"/>
      <mkdir dir="${builddir}/WEB-INF/lib"/>
   </target>

   <target name="copy" depends="prepare"
         description="Copy files to build directory.">
      <copy todir="${builddir}" failonerror="false" verbose="true">
         <fileset dir="${appdir}/web"/>
      </copy>
      <copy todir="${builddir}/WEB-INF/classes" 
           failonerror="false" verbose="true">
         <fileset dir="${appdir}/src/java">
            <exclude name="**/*.java"/>
         </fileset>
      </copy>
      <copy todir="${builddir}/WEB-INF/lib">
         <fileset dir="${jsf.lib.dir}" includes="${jsf.libs}"/>
         <fileset dir="${jstl.lib.dir}" includes="${jstl.libs}"/>
      </copy>      
      <copy todir="${builddir}/WEB-INF" failonerror="false" verbose="true">
         <fileset dir="${appdir}">
            <include name="lib/**"/>
         </fileset>
      </copy>
   </target>
   
   <target name="compile" depends="copy" 
         description="Compile source files.">
      <javac 
         srcdir="${appdir}/src/java" 
         destdir="${builddir}/WEB-INF/classes"
         debug="true"
         deprecation="true">
         <compilerarg value="-Xlint:unchecked"/>
         <include name="**/*.java"/>
         <classpath refid="classpath"/>
      </javac>
   </target>
   
   <target name="war" depends="compile"
         description="Build WAR file.">
      <delete file="${warfile}"/>
      <jar jarfile="${warfile}" basedir="${builddir}"/>
   </target>

   <target name="install" depends="war"
         description="Deploy web application.">
      <copy file="${warfile}" todir="${deploy.dir}"/>
   </target>

   <target name="clean" depends="init"
         description="Clean everything.">
      <delete dir="${builddir}"/>
   </target>
</project>
tomcat.dir=${env.TOMCAT_HOME}
jsf.dir=${env.JSF_HOME}

deploy.dir=${tomcat.dir}/webapps

servlet.api.jar=${tomcat.dir}/lib/servlet-api.jar
jsp.api.jar=${tomcat.dir}/lib/jsp-api.jar
el.api.jar=${tomcat.dir}/lib/el-api.jar
jsf.api.jar=${jsf.dir}/lib/jsf-api.jar

jsf.lib.dir=${jsf.dir}/lib
jstl.lib.dir=${tomcat.dir}/webapps/examples/WEB-INF/lib

jsf.libs=jsf-api.jar,jsf-impl.jar
jstl.libs=jstl.jar,standard.jar