ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject classpath problem
Date Sat, 03 Sep 2005 07:36:27 GMT

I've searched for a solution on this list, faq and google.
It's probably very simple. I am a beginner with ant.

I want to compile some files that are part of a webapp.
So they need the servlet-api.jar file.

When I run ant with the following build.xml file it can't find the
javax.servlet.* classes.

I've added a <classpath> element as below.
What am I doing wrong?

<project name="megaboard01" default="dist" basedir=".">
        simple example build file
  <!-- set global properties for this build -->
  <property name="src" location="../megaboard02/src/java"/>
  <property name="build" location="build"/>
  <property name="dist"  location="dist"/>

  <target name="init">
    <!-- Create the time stamp -->
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>

  <target name="compile" depends="init"
        description="compile the source " >
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>
          	<pathelement location="/progs/jakarta-tomcat-5.5.9/common/lib/servlet-api.jar"/>

  <target name="dist" depends="compile"
        description="generate the distribution" >
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>

    <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
    <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/>

  <target name="clean"
        description="clean up" >
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>

Kind regards.
.|  .| |.|/.|_ .
.|__.|_|.|\.|_ .
:61 421 276 282:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message