The Ant ear, war, and jar tasks might be able to update ears, wars, and jars, but I wouldn't depend upon it. Creating ears is a very quick task -- a few brief seconds, so it was never an issue I explored.
If you can't recreate the ear because the files you need are no longer available, you can try unzipping the ear, set what you need, and rebuild it from scratch.
<unzip src="${ear.file}"
destdir="${temp.location}"/>
<delete file="${ear.file}"/>
<here be dragons.../>
<zip destfile="${ear.file}"
basedir="${temp.location}"/>
You could use <patternset/>
s, or <zipfileset/>
s to control what gets zipped and unzipped, but it's probably easier unzipping and rebuilding.
If it makes you feel better, you can use <ear/>
instead of <zip>
, but you'll have to specify the appxml
parameter. It's just easier to use <zip/>
.