Stream editor for jar files?
I can't believe that I am the first person to have come across this requirement. Using BEA WebLogic or any other application server, you get deployment descriptors written into XML files that are contained in jar archives. What if you need to post-edit one or more configuration parameters?
In my case, after every build I need to go through half a dozen deployment descriptors and change "Required" to "NotSupported" in the ejb-jar.xml file of each. What I think is required is some kind of sed utility for jar files. Arguments would be the name of the jar file, the edit script (possibly just a single global replace regular expression), an optional XPATH expression to restrict the edit to a particular attribute or field, and optionally the relative path of the file within the archive to be edited (default = all). The program would extract the file(s) to be edited into a temporary location, apply the requested edit and then update the jar file with the resulting text / XML file(s).
I have come across a number of scripts that do this under Unix, using jar and sed, but nothing that would work under Windows. Before I write one, I'd like to know if anyone has already encountered and solved a similar problem.

