As an ex-unixadmin without winzip, it just didn't feel right and a swift bit of googling uncovered the 'u' option on jar which does exactly what I needed.
So, heres how to do it... assume your WAR is test.war, and you need to replace my/file inside it.
Get/check the path you need...
jar tvf ./test.war | grep "my/file"
Create a local tree structure to pop the file into...
mkdir -p ./my
cp ~/patches/my/file ./my/file
Now update the WAR with the new file...
jar -uf ./test.war my/file
Check its patched (i.e. is the file size updated?)
jar tvf ./test.war | grep "my/file"
No comments:
Post a Comment