Importing an OSGI bundle into eclipse

▼魔方 西西 提交于 2019-12-13 02:14:40

问题


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:

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


回答1:


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



来源:https://stackoverflow.com/questions/30917983/importing-an-osgi-bundle-into-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!