I am trying to update files inside an existing WAR file using the ANT WAR task. I need to replace a set of xml files in a folder in WAR with new ones from my HDD.
<war destfile="myApp.war" update="true" >
<zipfileset dir="<PathToStubsFolderOnHDD>" includes="**/*.xml" prefix="<PathToStubsFolderInWAR>"/>
</war>
This works fine if the original WAR does not have xmls with same name. However if the original WAR contains xmls with same name; WAR task does not update them with files from HDD.
The ANT WAR task documentation reads:
update | indicates whether to update or overwrite the destination file if it already exists. Default is "false".
duplicate | behavior when a duplicate file is found. Valid values are "add", "preserve", and "fail". The default value is "add".
if i use update="false"; all other files in the original WAR are deleted and only the new xmls stored.
using duplicate="add" didnot have any effect either.
Any suggestions on how this can be achieved??