开发者

What does Tool/Bundle-Name/Export-Package etc. mean in a jar manifest

开发者 https://www.devze.com 2022-12-12 23:50 出处:网络
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 direct

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:

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.co开发者_如何学JAVAmmons.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/


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.

This JavaWorld article is a good introduction.


This is OSGi. Eclipse uses it, also nutch.


From the Export-Package filed, I'd guess you are looking at an OSGi Bundle.

Check the Wikipedia article or the OSGi homepage for details.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号