【发布时间】:2017-07-27 22:48:53
【问题描述】:
我有一个依赖于第 3 方库的 OSGI 包,我不想在容器中部署该库,我宁愿将它嵌入到我的包中。
当然,那个库有它自己的依赖,我也想嵌入它们。
我正在使用Maven Bundle Plugin:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Description>${project.description}</Bundle-Description>
<Bundle-Vendor>${bundle.vendor}</Bundle-Vendor>
<Meta-Persistence>...</Meta-Persistence>
<Export-Package>...</Export-Package>
<Import-Package>...</Import-Package>
<Embed-Dependency>3rd-Party</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
</instructions>
</configuration>
</plugin>
因此,3rd-Party 被嵌入到生成的包中,但不是它的传递依赖项,好像<Embed-Transitive>true</Embed-Transitive> 没有任何效果。
所以我有一些问题
- 这是以传递方式嵌入第 3 方库的正确方法吗?
- 这是否会处理生成的 Manifest 文件(不导入属于 3rd 方库及其依赖项的包)?
谢谢
【问题讨论】:
-
你解决了吗?
-
如果我没记错的话,没有。这也是我停止使用 OSGI 的原因之一
-
您发现问题了吗?我在这里遇到了同样的问题:stackoverflow.com/questions/58457282/…。仍在寻找解决方案。
-
不,因此我放弃了 OSGI,不值得麻烦
标签: java maven osgi maven-bundle-plugin