eLRuLL eLRuLL - 4 months ago 33
Java Question

Generate war file from tomcat webapp folder

I have a tomcat server working, and there I have a webapp folder

my_web_app
.

I didn't deploy the project; I only have that folder of that application (as
TOMCAT_DIR/webapps/my_web_app
).

What I need is a WAR file. How can I create a
.war
file from this webapp?

Answer

You can create .war file back from your existing folder.

Using this command

cd /to/your/folder/location
jar -cvf my_web_app.war *