Linux command to extract a war file?

How to extract a .war file using Linux command line?

+77
java linux war
Sep 30 '10 at 18:18
source share
7 answers

Use unzip

unzip -c whatever.war META-INF/MANIFEST.MF 

It will print the output in the terminal.

And to extract all the files,

  unzip whatever.war 

Using a can

 jar xvf test.war 
+123
Sep 30 '10 at 18:21
source share

Or

jar xvf myproject.war

+29
Sep 30 '10 at 18:21
source share

A war file is just a zip file with a specific directory structure. This way you can use unzip or the jar tool to unpack.

But you probably don't want to do this. If you add the war file to the Tomcat Webapps directory, Tomcat will take care of extracting / installing the war file.

+8
Sep 30 '10 at 18:52
source share

You can use the unzip command.

+2
Sep 30 '10 at 18:19
source share

The best and easiest way to unpack a war is to use a can.

Example - jar xvf test.war

+1
Dec 12 '17 at 8:20
source share

To extract the contents of the war file into a directory:

 mkdir yourfile unzip yourfile.war -d yourfile 
+1
09 Oct '18 at 9:03
source share

First you can use any of the following commands:

  jar -xvf /path/to/yourfile.war unzip /path/to/yourfile.war 

After that, you should go to the following directory:

  cd /usr/local/standalone/deployments/yourfile.war/WEB-INF/classes/ 
0
Sep 17 '18 at 18:19
source share



All Articles