I\'m trying to update a file in an existing jar (in this example antlr) using the command:
jar -uf antlrworks-1.2.3.jar org/antlr/codegen/templates/Java/Java
You can do the same operation with the Ant jar task.
your files
the duplicate attribute with the preserve value will take care of the duplicate entries.
As mentioned here, the update attribute with the value “preserve” does tell you that duplicates exist, in this form:
aPath/aFile already added, skipping
If your file is on top of the list the jar task has to pick tp build itself, your new file will be taken into account.