ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Scokart <gscok...@gmail.com>
Subject Re: How to reference Shared Libraries in Ant
Date Sat, 06 Jun 2009 10:09:40 GMT
Did you tried providing a manifest file in your war that contains the
classpath you need?


Gilles Scokart


2009/6/3 Sarva <malhotrasarva@yahoo.in>

>
> 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/build.properties"/>
> <path id="classpath">
> <fileset dir="D:/eclipse/workspace/${lib.dir}">
> <include name="/.jar"/>
> </fileset>
> </path>
> <target name="clean">
> <echo>../${lib.dir}</echo>
> <echo>Cleaning the ${build.dir}</echo>
> <delete dir="${build.dir}"/>
> </target>
> <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>
> <target name="compile" depends="init">
> <echo>Compile the source files</echo>
> <javac srcdir="${src.dir}" destdir="${build.dir}/WEB-INF/classes">
> <classpath refid="classpath"/>
> </javac>
> </target>
> <target name="copy" depends="compile">
> <copy todir="${build.dir}/WEB-INF/">
> <fileset file="WebContent/WEB-INF/web.xml"/>
> </copy>
> <copy todir="${build.dir}/WEB-INF/classes/WSDL">
> <fileset file="${src.dir}/WSDL/"/>
> </copy>
> <copy todir="${build.dir}/WEB-INF/classes/META-INF/xfire">
> <fileset file="${src.dir}/META-INF/xfire/*"/>
> </copy>
> </target>
> <target name="war" depends="copy">
> <echo>Building the war file</echo>
> <war destfile="${dist.dir}/${project.name}.war"
> webxml="${build.dir}/WEB-INF/web.xml">
> <fileset dir="${build.dir}"/>
> </war>
> </target>
> </project>
>
>
> Thanks a Million
>
> Sarva
> --
> View this message in context:
> http://www.nabble.com/How-to-reference-Shared-Libraries-in-Ant-tp23845591p23845591.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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