用于提取war文件的Linux命令?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3833578/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Linux command for extracting war file?
提问by ammar
How can I extract a .war file with Linux command prompt?
如何使用 Linux 命令提示符提取 .war 文件?
回答by tangens
You can use the unzip
command.
您可以使用该unzip
命令。
回答by Jigar Joshi
Using unzip
使用解压
unzip -c whatever.war META-INF/MANIFEST.MF
It will print the output in terminal.
它将在终端中打印输出。
And for extracting all the files,
为了提取所有文件,
unzip whatever.war
Using jar
使用罐子
jar xvf test.war
Note! The jar
command will extract war contents to current directory. Notto a subdirectory (like Tomcat does).
笔记!该jar
命令会将战争内容提取到当前目录。不是子目录(就像 Tomcat 那样)。
回答by Raghuram
Or
或者
jar xvf myproject.war
jar xvf myproject.war
回答by Kdeveloper
A war file is just a zip file with a specific directory structure. So you can use unzip or the jar tool for unzipping.
war 文件只是一个具有特定目录结构的 zip 文件。所以你可以使用 unzip 或 jar 工具进行解压。
But you probably don't want to do that.If you add the war file into the webapps directory of Tomcat the Tomcat will take care of extracting/installing the war file.
但你可能不想这样做。如果您将 war 文件添加到 Tomcat 的 webapps 目录中,Tomcat 将负责提取/安装 war 文件。