使用< Embed-Dependency>在OSGI捆绑软件中添加jar的问题; [英] Issue with adding jar in OSGI bundle using <Embed-Dependency>
问题描述
我试图将第三方库和应用程序jar嵌入OSGI捆绑中.我阅读了felix maven插件文档,并尝试使用 Embed-Dependency .但这似乎没有任何作用.这是我的pom
I'm trying to embed third party libs and application jar in a OSGI bundle.I read the felix maven plugin document and tried using Embed-Dependency. But it doesn't seem to have any effect. Here's my pom
<dependencies>
<dependency>
<groupId>com.test</groupId>
<artifactId>taxonomymessagebundle</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>com.test.taxonomy.dao.*;version=1.0.0</Export-Package>
<Import-Package>*</Import-Package>
</instructions>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</configuration>
</plugin>
</plugins>
</build>
我正在 mvn全新安装来构建捆绑软件.安装后,我查看了清单文件,它没有显示任何Bundle-Classpath或Embed信息.看起来它完全忽略了指令.另外,两个从属的jar也没有嵌入包中.
I'm mvn clean install to build the bundle. After the install, I took a look into the manifest file, it doesn't show any Bundle-Classpath or Embed information. Looks like it completely ignored the instruction. Also, the two dependent jars were not embedded as well in the bundle.
这是生成的清单:
code>
Manifest-Version: 1.0
Export-Package: com.test.taxonomy.dao;uses:="com.autodesk.taxonomy";version="1.0.0"
Bundle-Version: 1.0.0
Build-Jdk: 1.6.0_21
Built-By: bandops
Tool: Bnd-0.0.357
Bnd-LastModified: 1307492329392
Bundle-Name: Taxonomy Dao Bundle
Bundle-ManifestVersion: 2
Created-By: Apache Maven Bundle Plugin
Import-Package: com.test.taxonomy.dao;version="1.0",com.autodesk.test.message
Bundle-SymbolicName: com.test.taxonomy.daobundle
任何指针都会受到赞赏.
Any pointers will be appreciated.
-谢谢
推荐答案
<Embed-Dependency>
和<Embed-Transitive>
应该都在<instructions>
标记内.
这篇关于使用< Embed-Dependency>在OSGI捆绑软件中添加jar的问题;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!