ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Updating JARS then WAR and at least EAR files using Ant
Date Mon, 04 Aug 2003 15:23:07 GMT
> I've an EAR file which contains a WAR file. This WAR file 
> contains some
> JAR files as librairies. I've to update some JAR files, and 
> consequently
> both the WAR and the EAR files.
>  
> How to do each of these updates using Ant?


<target name="ear" depends="war,ejb,rar">
    <ear destfile="ear/myapp.ear" ...>
        <fileset dir="ejbs" include="*.jar"/>
        <fileset dir="wars" include="*.war"/>
        <fileset dir="rars" include="*.rar"/>
        <fileset dir="libs" include="*.jar"/>
    </ear>
</target>

<target name="war" depends="jar">
    <war destfile="wars/frontend.war" ...>
         <!-- all your frontend content -->
    </war>
</target>

<target name="rar"/>  <!-- similar thing as above -->
<target name="ejb"/>



>  
> Is it possible to do it without having to explode both the EAR and the
> WAR files into a directories structure, then to make changes, then to
> recreate both the WAR and the EAR files?


<zip> supports nested <zipfileset src=""/> which merges contents of another
zip file into the new one. JAR is the same format, so you can use that.

Well, lets have look into the source, I thought ...

Yep: <jar> extends <zip>. <ear> and <war> extends <jar>.
Therefore a nested <zipfileset> should be possible. Try it out :-)



Jan

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