ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: poking into a war file
Date Mon, 25 Jun 2007 11:28:26 GMT
I think the easiest is to unzip your war using Ant unzip task and construct
a regular classpath from its lib directory.

Xavier

On 6/25/07, Bhatia Saurabh <Bhatia@ofac.ch> wrote:
>
> Hello,
>
> Thanks to your previous inputs, I am able to retrieve my jar and war
> dependencies into my war project's lib directory. The next step is to
> compile my war project's sources with a classpath pointing to these jar
> and war dependencies in the project's lib directory. In my <classpath>
> element of my ant task, I can find my classes in the jars but not in the
> wars. I am looking for a way to poke into a war's WEB-INF/lib directory
> to find more jars and to be able to add them to my classpath for the
> compilation of my sources.
>
> Is there a way to poke inside a war file to look for the jars inside it
> ?
>
>
>
> Here is the snippet of my javac task.
>
>
>
> <target name="compile" depends="retrieve"
>
>             description="-> compile the source ">
>
>             <javac srcdir="${src}" destdir="${build}" debug="on"
>
>                   compiler="javac1.4" deprecation="true"
> optimize="true">
>
>                   <classpath>
>
>                        <!- ${lib} is the lib directory of my war project
> which contains the retrieved dependencies -->
>
>                         <fileset dir="${lib}">
>
>                              <include name="*.war" /> <!-- how can poke
> into this war's /WEB-INF/lib to find the jars I need ? -->
>
>                              <include name="*.jar" /> <!-- no problem
> adding jars directly in my lib directory to the classpath -->
>
>                         </fileset>
>
>                         <fileset
>
>                              dir="C:/Program
> Files/IBM/SDP70/runtimes/base_v61/java/jre/lib">
>
>                              <include name="*.jar" />
>
>                         </fileset>
>
>                         <fileset>
>
>                         </fileset>
>
>
>
>                   </classpath>
>
>             </javac>
>
>       </target>
>
>
>
> I checked the ant-contrib project also to find some way of adding jar
> files inside a war file to the classpath but didn't find anything yet.
>
> Would appreciate any pointers you all might have.
>
>
>
> Thanks
>
>
>
>
>
>


-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

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