如何使用bash读取JAR MANIFEST.MF文件 [英] How to read MANIFEST.MF file from JAR using Bash

查看:276
本文介绍了如何使用bash读取JAR MANIFEST.MF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从some.jar读MANIFEST.MF Maven的清单文件使用bash


解决方案

  $解压-q -c myarchive.jar META-INF / MANIFEST.MF


  • -q 将坐席从解压缩程序P $ PSS详细输出$

  • -c 将提取到stdout

例如:

  $解压-q -c公地郎2.4.jar META-INF / MANIFEST.MF清单-版本:1.0
蚂蚁版本:Apache Ant的1.7.0
创建-者:1.5.0_13-119公司(Apple Inc.)
包装:org.apache.commons.lang
拓名称:公郎
部分规格版本:2.4
规格供应商:Apache软件基金会
规格 - 标题:下议院郎
实现版本:2.4
实现供应商:Apache软件基金会
实现标题:下议院郎
实现厂商ID:org.apache
的X编译源-JDK:1.3
的X编译 - 目标 - JDK:1.2

另外,您可以使用 -p 而不是 -q -c


  

-p 提取文件,以管(标准输出)。不过该文件的数据发送到stdout和文件总是以二进制格式提取出来,就像它们被存储(不转换)。


I need to read MANIFEST.MF maven manifest file from "some.jar" using bash

解决方案

$ unzip -q -c myarchive.jar META-INF/MANIFEST.MF

  • -q will suppress verbose output from the unzip program
  • -c will extract to stdout

Example:

$ 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

Alternatively you can use -p instead of -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).

这篇关于如何使用bash读取JAR MANIFEST.MF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆