I would recommend looking at the documentation for Ant under the war task...they have 
an example that is very similar to your question.  I've cut-n-pasted it for ease of 
finding it.

Examples
Assume the following structure in the project's base directory:

thirdparty/libs/jdbc1.jar
thirdparty/libs/jdbc2.jar
build/main/com/myco/myapp/Servlet.class
src/metadata/myapp.xml
src/html/myapp/index.html
src/jsp/myapp/front.jsp
src/graphics/images/gifs/small/logo.gif
src/graphics/images/gifs/large/logo.gif

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"/>
</war>

will consist of 
WEB-INF/web.xml
WEB-INF/lib/jdbc2.jar
WEB-INF/classes/com/myco/myapp/Servlet.class
META-INF/MANIFEST.MF
index.html
front.jsp
images/small/logo.gif
images/large/logo.gif

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 [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 4:42 PM
To: [EMAIL PROTECTED]
Subject: war task question


Hi,
I have the following source organization I'd like to get into a war
file:

/lib/jar1.jar
/lib/jar2.jar
/lib/jar3.jar
/build/myjar1.jar
/build/myjar2.jar
/images/image1.gif
/images/image2.gif
/config/web.xml
/config/otherConfiguration.prop
/html/file1.html
/html/file2.html

I need all the jars in the lib directory except one, and the jars in the
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>
</target>

Can someone please help me fill in the rest? ;)  

Thanks,

Yoav Shapira
Millennium ChemInformatics



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to