Hi,
I'm using the version of Ant that comes with netbeans 3.2, and I'm using a
slightly modified version of build.xml that came from the tomcat
documentation. I've set up my directory structure to match those docs, with
a root directory containing src, lib, etc and web, and then having a
deployment directory in the tomcat/webapps directory.
The problem I'm having is that when I do a compile, the compiler doesn't
pick up the jars that I have in WEB-INF/lib, even though that directory is
on the classpath for the javac. The compile fails because if can't find
jdom, where jdom.jar is in the WEB-INF/lib directory. Am I missing
something obvious?
I've included my build.xml at the end of this mail.
Cheers,
Tim.
<?xml version="1.0" encoding="UTF-8"?>
<!-- A "project" describes a set of targets that may be requested
when Ant is executed. The "default" attribute defines the
target which is executed if no specific target is requested,
and the "basedir" attribute defines the current working directory
from which Ant executes the requested task. This is normally
set to the current working directory.
-->
<project basedir="c:\JavaDev\Toolkit" default="compile" name="Web Toolkit">
<property name="app.name" value="toolkit"/>
<property name="tomcat.home" value="/jakarta-tomcat-3.2.1"/>
<property name="deploy.home" value="${tomcat.home}/webapps/${app.name}"/>
<property name="dist.home" value="${deploy.home}"/>
<property name="dist.src" value="${app.name}.jar"/>
<property name="dist.war" value="${app.name}.war"/>
<property name="javadoc.home" value="${deploy.home}/javadoc"/>
<target name="prepare">
<mkdir dir="${deploy.home}"/>
<copy todir="${deploy.home}">
<fileset dir="web"/>
</copy>
<mkdir dir="${deploy.home}/WEB-INF"/>
<copy file="etc/web.xml" tofile="${deploy.home}/WEB-INF/web.xml"/>
<mkdir dir="${deploy.home}/WEB-INF/classes"/>
<mkdir dir="${deploy.home}/WEB-INF/lib"/>
<copy todir="${deploy.home}/WEB-INF/lib">
<fileset dir="lib"/>
</copy>
<mkdir dir="${javadoc.home}"/>
</target>
<target name="clean">
<delete dir="${deploy.home}" verbose="true"/>
</target>
<target depends="prepare" name="compile">
<javac
classpath="$(deploy.home}/WEB-INF/lib;${deploy.home}/WEB-INF/classes"
debug="false" deprecation="off" destdir="${deploy.home}/WEB-INF/classes"
optimize="off" srcdir="src" verbose="false"/>
<copy todir="${deploy.home}/WEB-INF/classes">
<fileset dir="src" includes="**/*.properties"/>
</copy>
</target>
<target depends="prepare" name="javadoc">
<javadoc destdir="${javadoc.home}" packagenames="*" sourcepath="src"/>
</target>
<target depends="clean,prepare,compile,javadoc" name="all"/>
<target depends="prepare,compile" name="dist">
<jar basedir="." jarfile="${dist.home}/${dist.src}"/>
<jar basedir="${deploy.home}" jarfile="${dist.home}/${dist.war}"/>
</target>
</project>
This e-mail and its attachments are for the use of the addressee only.
It may contain information that is legally privileged, confidential and
exempt from disclosure. It is not a contract, and prices, data
and other information are not warranted as to completeness or accuracy.
Any comments or statements made herein do not necessarily
reflect those of PanCredit Systems Limited. If you are not the intended
recipient you must not copy, distribute or disseminate this e-mail
or attachments to anyone other than the addressee.
If you receive this communication in error please advise us by telephone
at once.
PanCredit Systems Limited
Tel: +44 113 250 0260
Fax: +44 113 250 0621