Maven OpenDaylight OSGi即使在安装RDF4J包之后也找不到RDF4J类

Maven OpenDaylight OSGi即使在安装RDF4J包之后也找不到RDF4J类,maven,osgi,opendaylight,maven-bundle-plugin,rdf4j,Maven,Osgi,Opendaylight,Maven Bundle Plugin,Rdf4j,如果我只将RDF4J与Maven(没有OSGi容器)一起使用,我就能够利用RDF4J提供的所有类。但是,当我将RDF4J与OpenDaylight一起使用时,我使用RDF4J类的包不会启动,因为未满足需求。 我正在使用IntelliJ Idea,我创建了一个具有OpenDaylight原型的新项目,其groupId:org.OpenDaylight.controller,artifactId:OpenDaylight启动原型,版本:1.4.0-SNAPSHOT和存储库: 我的包的组ID:org.

如果我只将RDF4J与Maven(没有OSGi容器)一起使用,我就能够利用RDF4J提供的所有类。但是,当我将RDF4J与OpenDaylight一起使用时,我使用RDF4J类的包不会启动,因为未满足需求。 我正在使用IntelliJ Idea,我创建了一个具有OpenDaylight原型的新项目,其groupId:org.OpenDaylight.controller,artifactId:OpenDaylight启动原型,版本:1.4.0-SNAPSHOT和存储库:

我的包的组ID:org.exmaple, 工件ID:rdfTest, 版本:1.0-SNAPSHOT, 我使用的是maven 3.3.9

原型编译成功,我能够安装所有功能。(./karaf/target/assembly/bin/karaf,然后按功能:install命令安装功能)

但是当我在impl文件夹的pom.xml中添加RDF4J依赖项时

  <dependency>
      <groupId>org.eclipse.rdf4j</groupId>
      <artifactId>rdf4j-runtime-osgi</artifactId>
      <version>2.2.2</version>
  </dependency>
我认为问题在于没有安装RDF4J捆绑包。我尝试了不同的方法来安装它,但没有一种有效()


有没有办法在OpenDaylight中使用RDF4J?

好的,我现在已经让它工作了。我手动安装了rdf4j运行时osgi包和其他必需的依赖项。以下是我安装的捆绑包:

bundle:install -s mvn:org.mapdb/mapdb/1.0.8
bundle:install -s mvn:com.spatial4j/spatial4j/0.4.1
bundle:install -s mvn:com.opencsv/opencsv/3.2
bundle:install -s mvn:org.apache.httpcomponents/httpcore-osgi/4.4.6
bundle:install -s mvn:org.apache.httpcomponents/httpclient-osgi/4.5.3
bundle:install -s mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0
bundle:install -s mvn:com.fasterxml.jackson.core/jackson-core/2.9.0
bundle:install -s mvn:com.fasterxml.jackson.core/jackson-databind/2.9.0
bundle:install -s mvn:ch.qos.logback/logback-core/1.2.2
bundle:install -s mvn:org.slf4j/slf4j-api/1.7.25
bundle:install -s mvn:ch.qos.logback/logback-classic/1.2.2
bundle:install -s mvn:com.github.jsonld-java/jsonld-java/0.11.1
bundle:install -s mvn:org.eclipse.rdf4j/rdf4j-runtime-osgi/2.2.2
然后启动bundle,我在其中使用了RDF4J和bundle:start。后来,我将所有这些安装说明都包含在我正在开发的功能下features文件夹的features.xml文件中,这样我就不必每次都手动安装它们了

    <bundle><![CDATA[wrap:mvn:org.mapdb/mapdb/1.0.8$Bundle-Version=1.0.8&Bundle-SymbolicName=mapdb]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.spatial4j/spatial4j/0.4.1$Bundle-Version=0.4.1&Bundle-SymbolicName=spatial4j]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.opencsv/opencsv/3.2$Bundle-Version=3.2&Bundle-SymbolicName=opencsv]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.apache.httpcomponents/httpcore-osgi/4.4.6$Bundle-Version=4.4.6&Bundle-SymbolicName=httpcore-osgi]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.apache.httpcomponents/httpclient-osgi/4.5.3$Bundle-Version=4.5.3&Bundle-SymbolicName=httpclient-osgi]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0$Bundle-Version=2.9.0&Bundle-SymbolicName=jackson-annotations]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.fasterxml.jackson.core/jackson-core/2.9.0$Bundle-Version=2.9.0&Bundle-SymbolicName=jackson-core]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.fasterxml.jackson.core/jackson-databind/2.9.0$Bundle-Version=2.9.0&Bundle-SymbolicName=jackson-databind]]></bundle>
    <bundle><![CDATA[wrap:mvn:ch.qos.logback/logback-core/1.2.2$Bundle-Version=1.2.2&Bundle-SymbolicName=logback-core]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.slf4j/slf4j-api/1.7.25$Bundle-Version=1.7.25&Bundle-SymbolicName=slf4j-api]]></bundle>
    <bundle><![CDATA[wrap:mvn:ch.qos.logback/logback-classic/1.2.2$Bundle-Version=1.2.2&Bundle-SymbolicName=logback-classic]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.github.jsonld-java/jsonld-java/0.11.1$Bundle-Version=0.11.1&Bundle-SymbolicName=jsonld-java]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.eclipse.rdf4j/rdf4j-runtime-osgi/2.2.2$Bundle-Version=2.2.2&Bundle-SymbolicName=rdf4j-runtime]]></bundle>

我尝试使用ApacheJena而不是RDF4J,但在这里我也遇到了同样的问题。这些特性已经安装,但bundle没有安装,它们处于解析状态,bundle:headers提供缺少的导入(org.apache.jena.rdf.model)。如果有人知道如何使用这些工具,那将是一个很大的帮助。
    <bundle><![CDATA[wrap:mvn:org.mapdb/mapdb/1.0.8$Bundle-Version=1.0.8&Bundle-SymbolicName=mapdb]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.spatial4j/spatial4j/0.4.1$Bundle-Version=0.4.1&Bundle-SymbolicName=spatial4j]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.opencsv/opencsv/3.2$Bundle-Version=3.2&Bundle-SymbolicName=opencsv]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.apache.httpcomponents/httpcore-osgi/4.4.6$Bundle-Version=4.4.6&Bundle-SymbolicName=httpcore-osgi]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.apache.httpcomponents/httpclient-osgi/4.5.3$Bundle-Version=4.5.3&Bundle-SymbolicName=httpclient-osgi]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.0$Bundle-Version=2.9.0&Bundle-SymbolicName=jackson-annotations]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.fasterxml.jackson.core/jackson-core/2.9.0$Bundle-Version=2.9.0&Bundle-SymbolicName=jackson-core]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.fasterxml.jackson.core/jackson-databind/2.9.0$Bundle-Version=2.9.0&Bundle-SymbolicName=jackson-databind]]></bundle>
    <bundle><![CDATA[wrap:mvn:ch.qos.logback/logback-core/1.2.2$Bundle-Version=1.2.2&Bundle-SymbolicName=logback-core]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.slf4j/slf4j-api/1.7.25$Bundle-Version=1.7.25&Bundle-SymbolicName=slf4j-api]]></bundle>
    <bundle><![CDATA[wrap:mvn:ch.qos.logback/logback-classic/1.2.2$Bundle-Version=1.2.2&Bundle-SymbolicName=logback-classic]]></bundle>
    <bundle><![CDATA[wrap:mvn:com.github.jsonld-java/jsonld-java/0.11.1$Bundle-Version=0.11.1&Bundle-SymbolicName=jsonld-java]]></bundle>
    <bundle><![CDATA[wrap:mvn:org.eclipse.rdf4j/rdf4j-runtime-osgi/2.2.2$Bundle-Version=2.2.2&Bundle-SymbolicName=rdf4j-runtime]]></bundle>