相关疑难解决方法(0)

使用<Embed-Dependency>在OSGI包中添加jar的问题

我正在尝试在OSGI包中嵌入第三方库和应用程序jar.我阅读了felix maven插件文档并尝试使用Embed-Dependency.但它似乎没有任何影响.这是我的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>
Run Code Online (Sandbox Code Playgroud)

我是mvn clean install来构建bundle.安装完成后,我查看了清单文件,它没有显示任何Bundle-Classpath或Embed信息.看起来它完全忽略了指令.此外,两个相关的罐子也没有嵌入捆绑中.

这是生成的清单:

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

任何指针将不胜感激.

-谢谢

osgi esb maven

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

esb ×1

maven ×1

osgi ×1