You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by wolverine my <wo...@gmail.com> on 2005/08/30 08:06:21 UTC

War task to include multiple lib files?

Hi!
 I'm using Ant 1.6.5 and I have the following Ant task:
  <war destfile="${dist.dir}/${app.name <http://app.name>}.war" webxml="${
web.dir}/WEB-INF/web.xml">
<classes dir="${build.dir}/WEB-INF/classes"/>
<lib dir="${lib.dir}">
<filename name="a.jar"/>
<filename name="b.jar"/>
</lib>
<metainf dir="${web.dir}/WEB-INF">
<filename name="context.xml"/>
</metainf>
</war>
 The Ant task is executed successfully but there is no WEB-INF/lib archived 
in the WAR file.
However if I delete "b.jar" from the <lib> then the WAR will contains 
WEB-INF/lib/a.jar
 What could be the problem? Can we specify more than one file for <lib>?

Re: War task to include multiple lib files?

Posted by Petar Tahchiev <pa...@gmail.com>.
On 30/08/05, wolverine my <wo...@gmail.com> wrote:
> 
> Hi!
> I'm using Ant 1.6.5 and I have the following Ant task:
> <war destfile="${dist.dir}/${app.name <http://app.name> <http://app.name>}.war" 
> webxml="${
> web.dir}/WEB-INF/web.xml">
> <classes dir="${build.dir}/WEB-INF/classes"/>
> <lib dir="${lib.dir}">
> <filename name="a.jar"/>
> <filename name="b.jar"/>
> </lib>
> <metainf dir="${web.dir}/WEB-INF">
> <filename name="context.xml"/>
> </metainf>
> </war>
> The Ant task is executed successfully but there is no WEB-INF/lib archived
> in the WAR file.
> However if I delete "b.jar" from the <lib> then the WAR will contains
> WEB-INF/lib/a.jar
> What could be the problem? Can we specify more than one file for <lib>?
> 
> lib attribute defines a fileset, so in order to insert more than one file 
you have to use:
<lib dir="">
<include name=""/>
<exclude name=""/>
</lib>

or just <lib dir=""/> where you point the directory that your libraries are.

-- 
Regards, Petar!