This question already has an answer here:

I have a foo.war file (JSF web app). I unzipped it just fine.

unzip foo.war

Then meta-inf and web-inf folders are extracted. I made a change to a properties file inside of web-inf and I repackageed it as foo.war.

However below command I tried didn't do it. It left out package name and Java classes under it from classes folder.

zip foo.war META-INF/* WEB-INF/*

marked as duplicate by roaima, Hunter.S.Thompson, Stephen Rauch, G-Man, Archemar Nov 25 '17 at 19:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • zip -r foo.war META-INF/ WEB-INF/ worked – DaeYoung Mar 2 '16 at 18:47
  • If you've solved your problem, please consider closing your question (or answering it, though I have a feeling "recursive zipping" has already been brought here). ;) – John WH Smith Mar 2 '16 at 21:34

running follow command fixed the problem.

zip -r foo.war META-INF/ WEB-INF/
  • the more general solution zip -r foo.war * should work too – jan Mar 12 '18 at 10:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.