2016-06-13 91 views
2

Maven的Apache的菲利克斯OSGI捆绑插件发出如下警告:这个“导入”maven-bundle-plugin 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>属性一起指定。

回答

4

错误告诉你它可以在指定为导入包的包中找到指​​定的Activator类。虽然这是一个非常不寻常的情况,但该类并未打包到您的包中。

我认为问题可能是私人包裹定义。您将com.joyent.manta.cosbench.config。*定义为私有。虽然带Activator的软件包未定义为私有或导出。

如果一个软件包不是私有的或导出的,它将不会被包含在jar中。相反,只会创建一个Import-Package语句。所以你sohuld定义包与Activator无论是私人或导出。那么它应该工作。

+0

该项目是开源的,OSGI配置在这里:https://github.com/joyent/cosbench-manta/blob/master/pom.xml#L165 – Elijah

+0

@Elijah请标记Christian接受的答案,因为它是以各种方式纠正。 –