【发布时间】:2020-01-23 17:37:44
【问题描述】:
我正在尝试开始使用 OSGI 并创建一个基本包。
我在 Eclipse (2019-06) 中创建了一个带有激活器的包,并选择 Liberty 作为目标运行时(最终目标是创建一个 Liberty 扩展)
它工作正常,但是当我将它转换为 Maven 时,Eclipse 抱怨 org.osgi 包无法解析
我看到这个依赖被定义了:
<dependency>
<groupId>net.wasdev.maven.tools.targets</groupId>
<artifactId>liberty-target</artifactId>
<version>19.0.0.9</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
我尝试将其添加到 felix 插件中,但没有成功。
<Import-Package>
org.osgi.framework
</Import-Package>
在尝试了一段时间之后,我准备放弃了。任何帮助将不胜感激。
【问题讨论】:
-
org.osgi包无法在运行时或编译时解析?请注意,在 Maven 中,依赖项是静态解析的,而在 OSGi 中,捆绑包可以在运行时安装,因此依赖项也在运行时解析。
标签: eclipse maven osgi bundle websphere-liberty