"imported in" maven-bundle-plugin OSGI 警告是什么意思?

What does this "imported in" maven-bundle-plugin OSGI warning mean?

Maven Apache Felix OSGI 捆绑插件发出以下警告:

Bundle-Activator x.x.x is being imported into the bundle rather than being
    contained inside it. This is usually a bundle packaging error

这个警告是什么意思?我的 BundleActivator 实现是用 <Bundle-Activator> 属性.

指定的

错误告诉您它可以在指定为导入包的包中找到您指定的激活器 class。 class 没有打包到您的包中,但这是一个非常不寻常的情况。

我认为问题可能出在 Private-Package 定义上。您将 com.joyent.manta.cosbench.config.* 定义为私有。虽然带有 Activator 的包未定义为私有或导出。

如果包不是私有的或导出的,那么它不会包含在 jar 中。相反,只会创建一个 Import-Package 语句。因此,您应该将带有 Activator 的包定义为私有包或导出包。然后它应该工作。