最近在做一个“把OSIG上的bundle结构的工程打成标准的war包来在各中间件上发布”的工作,给了自己一个了解OSGI底层源码的机会。过程中也发现了许多之前开发时没注意的小问题,譬如这个Dependencise中的Required Plug-ins和Imported Packages的区别,网上搜集了些资料,总结到这里吧:
参考自:http://blog.sina.com.cn/s/blog_69d0d3310100mehz.html
Required-Bundle: Specifythe list of plug-ins required for the operation of this plug-in.
Imported-Package:Specifypackages on which this plug-in depends without explicitly identifying theiroriginating plug-in.
Eclipse allows to define dependencies between plug-ins based on bundle or on package level. In theMANIFEST.MFof the plugin.xml you can tell that your plug-in should either depend onanother plug-in (and all its exported packages) or if your plug-in should onlydepend on the availability of certain packages no matter which plug-in isexporting t