ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sarva <>
Subject How to reference Shared Libraries in Ant
Date Wed, 03 Jun 2009 05:25:43 GMT

The User Library in WTP allows external JARs to be loaded in the project at
runtime, this allows reducing the overall WAR files, and reuse the common
libraries from many Web Applications, but somehow I cannot get the WAR to
reference the Shared Library location here is my ANT file, what do I need to
do, so that it will make the WAR load libraries from other than WEB-INF/lib,
for example from D:/eclipse/workspace/lib folder so many Web Services can
use it

<project name="invsBuilder" default="war" basedir="..">
<property file="ant/"/>
<path id="classpath">
<fileset dir="D:/eclipse/workspace/${lib.dir}">
<include name="/.jar"/>
<target name="clean">
<echo>Cleaning the ${build.dir}</echo>
<delete dir="${build.dir}"/>
<target name="init" depends="clean">
<echo>Creating the build directory</echo>
<mkdir dir="${build.dir}/WEB-INF/classes"/>
<mkdir dir="${build.dir}/WEB-INF/classes/WSDL"/>
<mkdir dir="${build.dir}/WEB-INF/classes/META-INF"/>
<mkdir dir="${build.dir}/WEB-INF/classes/META-INF/xfire"/>
<mkdir dir="${build.dir}/WEB-INF/lib"/>
<mkdir dir="${dist.dir}/"/>
<target name="compile" depends="init">
<echo>Compile the source files</echo>
<javac srcdir="${src.dir}" destdir="${build.dir}/WEB-INF/classes">
<classpath refid="classpath"/>
<target name="copy" depends="compile">
<copy todir="${build.dir}/WEB-INF/">
<fileset file="WebContent/WEB-INF/web.xml"/>
<copy todir="${build.dir}/WEB-INF/classes/WSDL">
<fileset file="${src.dir}/WSDL/"/>
<copy todir="${build.dir}/WEB-INF/classes/META-INF/xfire">
<fileset file="${src.dir}/META-INF/xfire/*"/>
<target name="war" depends="copy">
<echo>Building the war file</echo>
<war destfile="${dist.dir}/${}.war"
<fileset dir="${build.dir}"/>

Thanks a Million

View this message in context:
Sent from the Ant - Users mailing list archive at

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

View raw message