如果我只对Maven使用RDF4J (没有OSGi容器),我就能够利用RDF4J提供的所有类。但是,当我将RDF4J与OpenDaylight一起使用时,由于没有满足需求,我使用过RDF4J类的包不会启动。我正在使用IntelliJ的想法,我用OpenDaylight原型和groupId:org.opendaylight.controller创建了一个新项目,artifactId:opendaylight启动-原型,版本:1.4.0-快照和存储库:https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/archetype-catalog.xml
我的软件包的组ID:org.exmaple,伪ID: rdfTest,版本:1.0-快照,我使用的是maven 3.3.9
原型编译成功,我能够安装所有的功能。(./karaf/target/assembly/bin/karaf,然后按特性安装特性:install命令)
但是当我在RDF4J文件夹中的pom.xml中添加pom.xml依赖项时
<dependency>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-runtime-osgi</artifactId>
<version>2.2.2</version>
</dependency>如果在RdfTestProvider.java中添加以下内容,在impl/src/main/java/org/示例/impl中,该特性不会安装。
public void init() {
LOG.info("RdfTestProvider Session Initiated");
Repository rep = new SailRepository(new MemoryStore());
rep.initialize();
LOG.info("Repo successfully initialized");
}我认为问题在于RDF4J包没有安装。我尝试了不同的方法来安装它,但是没有一个有效(installing 3rd party non-osgi bundles)
有什么方法可以将RDF4J与OpenDaylight结合使用吗?
发布于 2017-09-26 18:16:05
好吧,我已经安排好了。我手动安装了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然后开始使用RDF4J与bundle一起使用的bundle:start。稍后,我在我正在开发的特性下的特性文件夹中的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>https://stackoverflow.com/questions/46399320
复制相似问题