微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何从JAR使用Bash读取MANIFEST.MF文件

我需要阅读MANIFEST.MF maven清单文件从“some.jar”使用bash
$ unzip -q -c myarchive.jar meta-inf/MANIFEST.MF

> -q将禁止解压缩程序的详细输出
> -c将提取到stdout

例:

$ unzip -q -c commons-lang-2.4.jar meta-inf/MANIFEST.MF

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 1.5.0_13-119 (Apple Inc.)
Package: org.apache.commons.lang
Extension-Name: commons-lang
Specification-Version: 2.4
Specification-vendor: Apache Software Foundation
Specification-Title: Commons Lang
Implementation-Version: 2.4
Implementation-vendor: Apache Software Foundation
Implementation-Title: Commons Lang
Implementation-vendor-Id: org.apache
X-Compile-Source-JDK: 1.3
X-Compile-Target-JDK: 1.2

或者,您可以使用-p而不是-q -c。

-p extract files to pipe (stdout). nothing but the file data is sent to stdout,and the files are always extracted in binary format,just as they are stored (no conversions).

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐