Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to list the contents of a jar file inside a war file

Tags:

jar

Lets say I have a .war file

myWarFile.war

This file has a jar file inside it - WEB-INF/myJarFile.jar

I want to see what are the files inside myJarFile.jar without extracting the war file.

Is there a way to do it?

like image 400
sunny8107 Avatar asked Jul 13 '10 14:07

sunny8107


People also ask

How can I see inside a WAR file?

If you don't want to extract the file you can use vim filename. war to read the contents of the file. You can read subdirectories of files by selecting them and pressing enter.

Does WAR file contain jar?

The WAR file (Web Application Resource or Web Application ARchive) is a container for JAR files, JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static sites (HTML and associated files), and other resources that make up an online application. A file entitled web.


1 Answers

jar xvf thewar.war /path/to/jar/inside/war #extract the file...    
jar tvf /path/to/jar/indide/war.jar # read the extracted jar  
rm /path/to/jar/inside/war # remove it 

I just did this and it did not delete the file I extracted from the war. Please verify that though...;)

like image 109
hvgotcodes Avatar answered Sep 30 '22 10:09

hvgotcodes