将OSGI捆绑包导入eclipse

问题描述:

我尝试将这个OSGI软件包[2] enj-library导入到eclipse中(用Maven编译后),我使用了: 文件>导入...>插件开发>插件和片段"

I try to import this OSGI bundle [2]enj-library into eclipse (after compiling it with Maven) , I used: "File > Import...> Plug-in Development > Plug-ins and fragments"

然后我导入了二进制文件

and I imported the binary

但是我得到了以下未解决的依赖项:

but I got the following unresolved dependencies:

在pom.xml中提到了这些依赖项:

These dependencies were mentionned in pom.xml:

<plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>1.2.1</version>
            <extensions>true</extensions>
            <configuration>
                <manifestLocation>META-INF</manifestLocation>
                <instructions>
                    <Import-Package>!org.junit.*,
                        !org.reflections.*,!it.polito.elite.enocean.*,*,com.google.common.base;version="14.0", com.google.common.collect;version="14.0"</Import-Package>
                    <Export-Package>it.polito.elite.enocean.enj.*,
                        it.polito.elite.enocean.protocol.*</Export-Package>
                    <Private-Package>it.polito.elite.enocean.test</Private-Package>
                    <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                    <Bundle-RequiredExecutionEnvironment>JavaSE-1.7</Bundle-RequiredExecutionEnvironment>
                    <Embed-Dependency>org.reflections.*;scope=compile|runtime;inline=false</Embed-Dependency>
                    <Embed-Directory>target/dependency</Embed-Directory>
                    <Embed-StripGroup>true</Embed-StripGroup>
                </instructions>
            </configuration>
        </plugin>

我该如何解决未解决的依赖性问题? 非常感谢您的帮助!

How can I solve this issue of unresolved dependencies? Thanks a lot for your help!

[2] https://github.com/dog-gateway/enj-library

您还需要安装将这些软件包导出到目标平台的捆绑软件.

You will need to also install bundles that export these packages into your target platform.