我有一个 OSGi 项目,其中包含带有编译范围的 sesame-runtime-osgi 依赖项。
<dependency>
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-runtime-osgi</artifactId>
<version>${sesame.version}</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
sesame-runtime-osgi 工件包括几个运行时依赖项。例如:
+- org.openrdf.sesame:sesame-runtime-osgi:jar:2.7.13:compile
| +- org.openrdf.sesame:sesame-http-client:jar:2.7.13:compile
| | +- org.openrdf.sesame:sesame-http-protocol:jar:2.7.13:compile
| | | \- org.openrdf.sesame:sesame-rio-ntriples:jar:2.7.6:compile
| | | \- commons-io:commons-io:jar:2.1:compile
| | +- org.openrdf.sesame:sesame-query:jar:2.7.13:compile
.
.
.
| | \- commons-codec:commons-codec:jar:1.4:runtime
| \- org.openrdf.sesame:sesame-http-server-spring:jar:2.7.13:compile
| +- org.openrdf.sesame:sesame-runtime:jar:2.7.6:compile
| | +- org.openrdf.sesame:sesame-repository-manager:jar:2.7.13:compile
.
.
.
| | +- org.openrdf.sesame:sesame-queryresultio-sparqljson:jar:2.7.13:runtime
| | | \- com.fasterxml.jackson.core:jackson-core:jar:2.2.2:runtime
| | +- org.openrdf.sesame:sesame-queryresultio-text:jar:2.7.13:runtime
| | | \- net.sf.opencsv:opencsv:jar:2.0:runtime
.
.
.
| \- cglib:cglib:jar:2.2:compile
| \- asm:asm:jar:3.1:compile
您会注意到“net.sf.opencsv:opencsv:jar:2.0”是一个运行时依赖项,因此它不包含在由 karaf-maven-plugin 生成的 feature.xml 中。不幸的是,运行时所需的包包含在 sesame-runtime-osgi Manifest 中的“Import-Packages”指令中:
Import-Package: au.com.bytecode.opencsv
因此,除非我自己手动包装和部署运行时依赖项,否则 Karaf 无法部署该功能。显然我不想这样做。
有没有办法可以在 feature.xml 生成中包含运行时范围的依赖项?
谢谢