ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Petar Tahchiev <paranoia...@gmail.com>
Subject Re: classpath problem
Date Mon, 05 Sep 2005 10:11:48 GMT
On 03/09/05, luke@chipcity.com.au <luke@chipcity.com.au> wrote:
> 
> Hi.
> 
> 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=".">
> <description>
> simple example build file
> </description>
> <!-- 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 -->
> <tstamp/>
> <!-- Create the build directory structure used by compile -->
> <mkdir dir="${build}"/>
> </target>
> 
> <target name="compile" depends="init"
> description="compile the source " >
> <!-- Compile the java code from ${src} into ${build} -->
> <javac srcdir="${src}" destdir="${build}"/>
> <classpath>
> <pathelement location="/progs/jakarta-tomcat-5.5.9/common/lib/servlet-
> api.jar"/>
> </classpath>
> </target>
> 
> <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>
> 
> <target name="clean"
> description="clean up" >
> <!-- Delete the ${build} and ${dist} directory trees -->
> <delete dir="${build}"/>
> <delete dir="${dist}"/>
> </target>
> </project>
> \_________
> 
> 
> Thanks.
> Kind regards.
> Luke.
> --
> ............._..
> .| .| |.|/.|_ .
> .|__.|_|.|\.|_ .
> :61 421 276 282:
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> Probably you have to enlose the <classpath> tag in your <javac> tag like

this:
<javac BLAH BLAH>
<classpath>
BLAH BLAH
</classpath>
</javac>


-- 
Regards, Petar!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message