Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
AW: JAR WAR Best practices

AW: JAR WAR Best practices

2003-03-12       - By Jan.Materne@(protected)

Maybe a parameterized target could help.


<target name="makeWar">
   <property name="webxml" value="default-web.xml"/>
   <property name="additionalFS" value="noAddFS"/>
   <fileset id="noAddFS"/>
   <war .... webxml="${webxml}">
       <classes id="commonFS" />
       <classes id="${additionalFS}"/>
       ...
   </war>
</target>

<target name="makeWar1">
   <antcall target="makeWar"><param ...></antcall>
</target>
<target name="makeWar2">
   <antcall target="makeWar"><param ...><param name="additionalFS"
...></antcall>
</target>

But I don?t know whether <war> supports multiple <classes>/<lib>s. Not
tried, therefore
just thoughts.


Jan Mat?rne

-----Urspr?ngliche Nachricht-----
Von: Matthew Oatham [mailto:matthewoatham@(protected)]
Gesendet am: Mittwoch, 12. M?rz 2003 10:04
An: user@(protected)
Betreff: JAR WAR Best practices

Hi,

I am building a project which creates many WAR and JAR files for
distribution. I have broken these down into two common base files, a WAR and
a JAR that all other distributables can extend from. For example:

WAR 1 (base)

WAR 2 (extends base)

I build WAR 1 and it includes

/WEB-INF/web.xml
/WEB-INF/lib/THIRD_PARTY.jar
/WEB-INF/classes/SOME_CLASSE.class

Now WAR 2 is identical except it overrides web.xml by and requires
additional classes. To save time I decided it may be better to copy WAR 1
and extend it by adding the additional classes and overriding web.xml.

Does anyone currently do anything like this? Do you have any suggestions on
how I could base my approach? Should I copy or use zipgroupfileset? Any idea
appriciated.

Cheers.




©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.