ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wey, Gerald" <>
Subject RE: war task question
Date Tue, 04 Feb 2003 23:14:48 GMT
   Are you creating a staging directory? If your "createWar" target creates
a staging directory you can copy whichever .jars that you want into the
WEB-INF\lib directory that you choose to put there. Then call the war task,
and set the base directory to the staging directory and it will build a war
with what you have placed in the WEB-INF\lib. Note you also will need to
include a <copy> task for the Image, html, etc files. Here is a portion of
my build.xml. I hope it helps.

<target name="buildWar" depends="jspc">
      <mkdir dir="${war.staging.dir}WEB-INF/lib" />

      <copy todir="${war.staging.dir}/WEB-INF/lib">
         <fileset dir="${lib.dir}" />
	<copy todir="${war.staging.dir}}/WEB-INF/lib">
         <fileset dir="${build.dir}" />
         	<exclude name="this.jar" />
		<exclude name="that.jar" />
		<exclude name="theOther.jar" />

      <war warfile="${war.file}" 
           duplicate="preserve" />

-----Original Message-----
From: Shapira, Yoav []
Sent: Tuesday, February 04, 2003 5:48 PM
To: Ant Users List
Subject: RE: war task question

Thanks.  I'd read that documentation (and anything else I could find on
the war task), as well as searched the list archives, prior to posting
my question.

One problem is that I have my build results in a jar file, not class
files.  I don't know anything to go into the /WEB-INF/classes directory
of the war file.  I don't want to use a nested <classes> element inside
my .war task.  I want the jar files from my build directory, as well as
(some of) those from my lib directory, to go into the /WEB-INF/lib
directory of the war file.

Any ideas, suggestions welcome.

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Scott Francis []
>Sent: Tuesday, February 04, 2003 5:46 PM
>To: Ant Users List
>Subject: RE: war task question
>I would recommend looking at the documentation for Ant under the war
>task...they have an example that is very similar to your question.
>cut-n-pasted it for ease of finding it.
>Assume the following structure in the project's base directory:
>then the war file myapp.war created with
><war destfile="myapp.war" webxml="src/metadata/myapp.xml">
>  <fileset dir="src/html/myapp"/>
>  <fileset dir="src/jsp/myapp"/>
>  <lib dir="thirdparty/libs">
>    <exclude name="jdbc1.jar"/>
>  </lib>
>  <classes dir="build/main"/>
>  <zipfileset dir="src/graphics/images/gifs"
>              prefix="images"/>
>will consist of
>using Ant's default manifest file. The content of WEB-INF/web.xml is
>identical to src/metadata/myapp.xml
>-----Original Message-----
>From: Shapira, Yoav []
>Sent: Tuesday, February 04, 2003 4:42 PM
>Subject: war task question
>I have the following source organization I'd like to get into a war
>I need all the jars in the lib directory except one, and the jars in
>build directory, to go into the /WEB-INF/lib directory of the war file.
>The other files (html, images, config/otherConfiguration.prop) should
>just go under the war root directory (not under WEB-INF).
>I'm using Ant 1.5.1.
>My war task skeleton looks like:
><target name="createWarFile">
>  <war destfile="myWarFile.war" webxml="/config/web.xml">
>  </war>
>Can someone please help me fill in the rest? ;)
>Yoav Shapira
>Millennium ChemInformatics
>To unsubscribe, e-mail:
>For additional commands, e-mail:
>To unsubscribe, e-mail:
>For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

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