我有OSGI
一个依赖于第 3 方库的包,我不想在容器中部署该库,我宁愿将它嵌入到我的包中。
当然,那个库有它自己的依赖,我也想嵌入它们。
我正在使用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>
没有任何效果。
所以我有一些问题
- 这是以传递方式嵌入 3rd 方库的正确方法吗?
- 这是否会处理生成的清单文件(不导入属于 3rd 方库及其依赖项的包)?
谢谢