ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sthakor <sanjiv_tha...@yahoo.com>
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:
 /...../
        -3rd-party-libs/
             - 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"
update="true">
            <lib dir="${3rd-party-libs}/cometd-2.4.3/">
                <include name="*.jar"/>
            </lib>
        	<lib dir="${3rd-party-libs}/commons-lang3-3.1/">
                <include name="*.jar"/>
            </lib>
        	<lib dir="${3rd-party-libs}/restlet-jee-2.1.2/">
                <include name="*.jar"/>
            </lib>
            <fileset dir="WebContent"/>
            <classes dir="build/classes"/>
        </war>
    </target>



--
View this message in context: http://ant.1045680.n5.nabble.com/Create-WEB-INF-lib-based-on-path-structure-tp1350348p5713953.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
View raw message