简体   繁体   English

将Apache stanbol嵌入Java应用程序(Maven)

[英]Embed Apache stanbol in java application(Maven)

I am fairly new to maven and I cannot figure out how do I embed Apache Stanbol in my Maven application. 我对Maven相当陌生,我无法弄清楚如何在我的Maven应用程序中嵌入Apache Stanbol。

I have added the below dependency to my pom, the <type> is pom as there is no jar available in the repository. 我在pom中添加了以下依赖项,由于存储库中没有可用的jar,因此<type>是pom。

`</dependencies>
    <dependency>
        <groupId>org.apache.stanbol</groupId>
        <artifactId>apache-stanbol</artifactId>
        <version>0.12.0</version>
        <type>pom</type>
    </dependency>
</dependencies>`

How do I include Apache Stanbol in my java application, like open-nlp which is straight forward 我如何在我的Java应用程序中包括Apache Stanbol,例如open-nlp,这很简单

<dependency> <groupId>org.apache.opennlp</groupId> <artifactId>opennlp-tools</artifactId> <version>1.5.3</version> </dependency>

Apache Stanbol is OSGi based and if your application is OSGi based you can simply install the relavant bundles into your runtime. Apache Stanbol是基于OSGi的,如果您的应用程序是基于OSGi的,则只需将相关的捆绑软件安装到您的运行时中即可。 But if your application is not OSGi you will need to launch an embedded OSGi runtime and configure relevant Stanbol bundles there. 但是,如果您的应用程序不是OSGi,则需要启动嵌入式OSGi运行时并在其中配置相关的Stanbol捆绑软件。

This mail thread discusses this question [1] and the proposed solution is to configure Stanbol in an embedded Felix runtime as explained in [2]. 该邮件线程讨论了这个问题[1],提出的解决方案是在嵌入式Felix运行时中配置Stanbol,如[2]中所述。 However I haven't found an example where Stanbol has been embedded in a non OSGi application so far. 但是,到目前为止,我还没有找到将Stanbol嵌入非OSGi应用程序中的示例。

[1] http://mail-archives.apache.org/mod_mbox/incubator-stanbol-dev/201111.mbox/%3CCABMc4VYP5e+vtW1As1yP7RRnSg84DjtApZ9J5vpS14ryV6OQ1Q@mail.gmail.com%3E [1] http://mail-archives.apache.org/mod_mbox/incubator-stanbol-dev/201111.mbox/%3CCABMc4VYP5e+vtW1As1yP7RRnSg84DjtApZ9J5vpS14ryV6OQ1Q@mail.gmail.com%3E

[2] https://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html#ApacheFelixFrameworkLaunchingandEmbedding [2] https://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html#ApacheFelixFrameworkLaunchingandEmbedding

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM