java Tool/Bundle-Name/Export-Package 等在 jar 清单中是什么意思
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1816606/
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
What does Tool/Bundle-Name/Export-Package etc. mean in a jar manifest
提问by leeeroy
I'm looking at the manifest.mf for some apache libraries. While I can guess what Export-Package means, I can't find any documentation for these attributes ? Could anyone point me in the right direction. Here.s an example:
我正在查看某些 apache 库的 manifest.mf。虽然我能猜到 Export-Package 是什么意思,但我找不到这些属性的任何文档?谁能指出我正确的方向。这是一个例子:
Manifest-Version: 1.0
Created-By: 1.6.0_07 (Sun Microsystems Inc.)
Built-By: pemben
Implementation-Title: Commons BeanUtils
Implementation-Vendor: The Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 1.8.2
Specification-Title: Commons BeanUtils
Specification-Vendor: The Apache Software Foundation
Specification-Version: 1.8.2
Export-Package: org.apache.commons.beanutils.locale.converters;
Private-Package: org.apache.commons.collections;version="1.8.2"
Ignore-Package: org.apache.commons.collections
Tool: Bnd-0.0.238
Bundle-Name: Commons BeanUtils
Bundle-Vendor: The Apache Software Foundation
Bundle-Version: 1.8.2
Bnd-LastModified: 1257775355133
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-Description: BeanUtils provides an easy-to-use but flexible wra
pper around reflection and introspection.
Import-Package: org.apache.commons.beanutils;version="1.8.2"
Bundle-SymbolicName: org.apache.commons.beanutils
Bundle-DocURL: http://commons.apache.org/beanutils/
采纳答案by Brian Agnew
The Bundle attributes define info wrt. OSGi bundles. An OSGi bundle is simply a .jar file that also defines (via the attributes) what it exports, and what its dependencies are (including versions). Note that the .jar file can be used as a standard .jar file - the bundle information is only used in an OSGi container.
Bundle 属性定义了 info wrt。OSGi捆绑包。OSGi 包只是一个 .jar 文件,它还定义(通过属性)它导出的内容以及它的依赖项(包括版本)。请注意,.jar 文件可用作标准 .jar 文件 - 包信息仅用于 OSGi 容器。
This JavaWorld articleis a good introduction.
这篇 JavaWorld 文章是一个很好的介绍。
回答by Joachim Sauer
From the Export-Packagefiled, I'd guess you are looking at an OSGi Bundle.
从Export-Package归档中,我猜您正在查看OSGi Bundle。
Check the Wikipedia article or the OSGi homepagefor details.
查看 Wikipedia 文章或OSGi 主页了解详细信息。
回答by omerkudat
If you want really good explanations for the meanings of OSGi Manifest entries, I strongly suggest you read the specification. It is not very long and will explain in good detail all you want to know. Also, keep in mind that the Manifest.mf file is not specific to OSGi; other Java libraries also make use of it. As such, not all the entries you see above are defined by the OSGi specification, such as 'Tool', and 'Bnd-LastModified', which were added by the Bnd utility.
如果您想对 OSGi Manifest 条目的含义进行很好的解释,我强烈建议您阅读规范。它不会很长,并且会详细解释您想知道的所有内容。另外,请记住 Manifest.mf 文件并非特定于 OSGi;其他 Java 库也使用它。因此,并非您在上面看到的所有条目都是由 OSGi 规范定义的,例如由Bnd 实用程序添加的“工具”和“Bnd-LastModified” 。
回答by bmargulies
This is OSGi. Eclipse uses it, also nutch.
这是OSGi。Eclipse 使用它,也是 nutch。

