Yoav:
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>
<copy todir="${war.staging.dir}}/WEB-INF/lib">
<fileset dir="${build.dir}" />
<exclude name="this.jar" />
<exclude name="that.jar" />
<exclude name="theOther.jar" />
</copy>
<war warfile="${war.file}"
webxml="${web.xml}"
basedir="${war.staging.dir}"
excludes="*.war"
update="true"
duplicate="preserve" />
</target>
-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 04, 2003 5:48 PM
To: Ant Users List
Subject: RE: war task question
Hi,
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 [mailto:[EMAIL PROTECTED]]
>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.
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]