Use Emacs to edit compressed .ear and .war files
If you're like me, you've often found yourself needing to change a setting, or view some information, buried deep inside a .ear or .war or .sar file. Well, you probably know that emacs can handle looking inside and editing files within a .tar or .jar file. Since .ear and .war files are just .jar files at their core, you can easily extend this feature to those file types.
Just add this to your ~/.emacs file:
(setq auto-mode-alist
(append
'(("\\.war\\'" . archive-mode))
'(("\\.ear\\'" . archive-mode))
'(("\\.sar\\'" . archive-mode))
auto-mode-alist))
And you'll get something that look like this:
emacs hudson.war
October 21st, 2007 at 11:12 pm
I’ve been an emacs user for nearly 20 years, and I did not realize that you could edit a file inside a ZIP from within emacs. Thank you so much.
October 22nd, 2007 at 7:54 am
Hey, no problem:)
November 18th, 2008 at 4:20 am
Because i have
(prefer-coding-system ‘utf-8-unix)
also need
(modify-coding-system-alist ‘file “\\.\\(war\\|ear\\|sar\\|egg\\)\\’” ‘no-conversion)
to
(add-to-list ‘auto-mode-alist ‘(”\\.\\(war\\|ear\\|sar\\|egg\\)\\’” . archive-mode))
–
Regards!