Generate war file from tomcat webapp folder

2022-08-31 16:01:07

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 file from this webapp?.war


答案 1

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

Using this command

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

答案 2

Its just like creating a file of your project, you can do it in several ways (from Eclipse, command line, maven).WAR

If you want to do from command line, the command is

jar -cvf my_web_app.war * 

Which means, "compress everything in this directory into a file named my_web_app.war" (c=create, v=verbose, f=file)


推荐