在开发 OSGi bundle 时,如果你的 Bundle 所依赖的某个 Jar 并不是一个 OSGi bundle(可以通过 MANIFEST.MF)文件看出来)。有一些解决方法:
- 将这个 Jar 包的 MANIFEST.MF 文件修改为符合 OSGi 规范的格式。这个工作可以手工做。(网上的使用 Eclipse 完成这个工作的方法我没有成功。成功者可告诉我方法)
- 将 Jar 包打入到你的 OSGi 包中。下面介绍使用 Felix 的 Maven Bundle plugin 去实现这个方法。
将下面的代码加入到你项目的 pom.xml 中。这样你所依赖的 Jar 将被打入到生产的 Bundle 的 Jar 包中。同时,原本 Import-Package 中的属于那些 Jar 包的 package 也会被移除。
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>
xxx.xxx
</Export-Package>
<Private-Package>
xxx.xxx
</Private-Package>
<Import-Package>
*
</Import-Package>
<Embed-Dependency>maven_dependency_artifact_id_1,artifact_id_2,...</Embed-Dependency>
</instructions>
</configuration>
</plugin>
分享到:
相关推荐
felix 可以用jar包felix 可以用jar包felix 可以用jar包felix 可以用jar包felix 可以用jar包
maven-osgi-plugin-launcher-framework-felix-1.0.21.jar
maven-osgi-plugin-launcher-framework-felix-1.0.20.jar
maven-osgi-plugin-launcher-framework-felix-1.0.19.jar
maven-osgi-plugin-launcher-framework-felix-1.0.18.jar
maven-osgi-plugin-launcher-framework-felix-1.0.17.jar
maven-osgi-plugin-launcher-framework-felix-1.0.16.jar
maven-osgi-plugin-launcher-framework-felix-1.0.15.jar
maven-osgi-plugin-launcher-framework-felix-1.0.14.jar
maven-osgi-plugin-launcher-framework-felix-1.0.13.jar
编译 mvn软件包将在目标中生成捆绑罐 跑步 将捆绑罐复制到OSGI容器,例如Felix或Faraf ...
Felix_OSGi实作,介绍最流行的OSGI framwork-Felix的好文档
在felix2.0.1扩展Hibernate,使之工作于OSGI框架之中。
struts2-osgi-admin-bundle-2.5.2.jar, struts2-osgi-demo-bundle-2.5.2.jar, struts2-osgi-plugin-2.5.2.jar, struts2-oval-plugin-2.5.2.jar, struts2-pell-multipart-plugin-2.5.2.jar, struts2-plexus-plugin-...
Gradle Felix 启动器插件 这是用于 Gradle 构建系统的 Felix ... 使用此依赖项配置定义的工件将被下载并添加到 felix 包目录中。 这个特性使得配置 felix 框架的 bundle 组合成为可能。 此配置将 felix 框架与 scr 和
struts2-osgi-admin-bundle-2.3.30.jar, struts2-osgi-demo-bundle-2.3.30.jar, struts2-osgi-plugin-2.3.30.jar, struts2-oval-plugin-2.3.30.jar, struts2-pell-multipart-plugin-2.3.30.jar, struts2-plexus-...
log4j-api-2.7.jar,ognl-3.1.12.jar,org.apache.felix.framework-4.0.3.jar,org.apache.felix.main-4.0.3.jar,org.apache.felix.shell-1.4.3.jar,org.apache.felix.shell.tui-1.4.1.jar,org.osgi.compendium-4.0.0....
NULL 博文链接:https://ssydxa219.iteye.com/blog/1471707
struts2-osgi-admin-bundle-2.3.15.3.jar struts2-osgi-demo-bundle-2.3.15.3.jar struts2-osgi-plugin-2.3.15.3.jar struts2-oval-plugin-2.3.15.3.jar struts2-pell-multipart-plugin-2.3.15.3.jar struts2-plexus...
A relentlessly practical beginner's guide that will walk you through making real-life OSGi applications while showing you the development tools (Maven, Eclipse, and so on) that will make the journey ...