ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sthakor <>
Subject Re: Create WEB-INF/lib based on path-structure
Date Wed, 13 Mar 2013 22:54:22 GMT
i went through a bunch of posts and did not find the answer.  Finally i
solved it as explained below.  my way is possibly a little verbose but it
does the job.  SO my goal was to be able to include my libs(.jar files)
which are in some third party dir referenced by $3rdParty-libs, into the
WEB-INF/lib directory.  Also the structure of my 3rd-party-libs is:
             - cometd-2.4.3/ 
                  - bunch of .jar files
             - commons-lang3-3.1/
                  - bunch of .jar files
             - restlet-jee-2.1.2/
                  - bunch of .jar files

     So in addition to getting all the required jar files under my war's
WEB-INF/lib directory i did NOT want the directory structure of these jar
files to be carried over 
    i.e  i did NOT want  WEB-INF/lib/cometd-2.4.3/<someCometd>.jar
i wanted it like: WEB-INF/lib/<someCometd>.jar

so the simple solution is to specify the war task's <lib> nested element
multiple times.  Once per directory that you want to reference inside your
3rd-party-libs directory.

Here is my war target:
    <target name="war" depends="compile">
        <war destfile="dist/waisApp.war" webxml="WebContent/WEB-INF/web.xml"
            <lib dir="${3rd-party-libs}/cometd-2.4.3/">
                <include name="*.jar"/>
        	<lib dir="${3rd-party-libs}/commons-lang3-3.1/">
                <include name="*.jar"/>
        	<lib dir="${3rd-party-libs}/restlet-jee-2.1.2/">
                <include name="*.jar"/>
            <fileset dir="WebContent"/>
            <classes dir="build/classes"/>

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