2

I am fairly new to maven and I cannot figure out how do I embed Apache Stanbol in my Maven application.

I have added the below dependency to my pom, the <type> is pom as there is no jar available in the repository.

`</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

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

Pragati Sureka
  • 1,412
  • 12
  • 18
  • Looking at [the list of Maven artifacts related to `org.apache.stanbol`](http://mvnrepository.com/artifact/org.apache.stanbol), it seems you would need to download a particular sub-project that meets your needs. – Duncan Jones Jun 11 '14 at 09:40
  • The dependency you have given is definitvley wrong, cause that's the module parent. Check the docs how to use it correctly. – khmarbaise Jun 11 '14 at 09:43
  • I want to use org.apache.stanbol.enhancer, so do i have to download the source or include org.apache.stanbol.enhancer as a separate dependency? – Pragati Sureka Jun 11 '14 at 09:43
  • You can use the org.apache.stanbol.enhancer as a dependency. That should be enough. – khmarbaise Jun 11 '14 at 09:44
  • adding `org.apache.stanbol.enhancer` seems same as adding `org.apache.stanbol` the api is not available in my application – Pragati Sureka Jun 11 '14 at 09:52

1 Answers1

0

Apache Stanbol is OSGi based and if your application is OSGi based you can simply install the relavant bundles into your runtime. But if your application is not OSGi you will need to launch an embedded OSGi runtime and configure relevant Stanbol bundles there.

This mail thread discusses this question [1] and the proposed solution is to configure Stanbol in an embedded Felix runtime as explained in [2]. However I haven't found an example where Stanbol has been embedded in a non OSGi application so far.

[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

Dileepa Jayakody
  • 535
  • 1
  • 6
  • 19