You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Stian Soiland-Reyes <so...@cs.manchester.ac.uk> on 2014/11/01 02:24:49 UTC

Please test: Jena OSGi bundle

I have suggested for Jena to add an OSGi bundle "jena-osgi" -
https://github.com/apache/jena/pull/10


I've done it as a single bundle of the major modules (those in the
distribution ZIP) - effectively putting them all on the same
classloader to avoid any issues with the service registries, as part
of Jena still use Class.forName() across modules (...I know).

(Longer term one would of course rather get rid of Class.forName, and
then each module of Jena could be a bundle. This would however require
a bit more work/thought. )


If you are an OSGi user, then perhaps you could test this bundle so we
can see if it is a sane approach.  It would also be good to hear what
is the approach you've done in using Jena in your bundles so far.


I have personally only tested this bundle in a single product where I
just do load and save of JSON-LD using Jena RIOT, and some simple
graph inspection. So I am sure I've not done everything right.. so we
need to test it a bit more.


You can either check out
 https://github.com/stain/jena

using the branch
  jena-osgi-bundle

then use "mvn install" on:

jena-parent
jena-osgi

The remaining modules should be pulled from the fresh snapshots in
http://repository.apache.org/snapshots/


(I've used the maven-bundler-plugin to generate the manifest and to
embed the jena-* JARs within the bundle JAR - see the
jena-osgi/pom.xml for details  -- I am particularly wondering how I
can exclude libthrift as that is also available as a bundle)



Alternatively I have a full build of that branch from our build server at

http://build.mygrid.org.uk/ci/job/jena-bundle/21/

that deploys to the Maven repository at:

http://repository.mygrid.org.uk/artifactory/ext-snapshot-local/


(Note that the virtual machine host of this server has been a bit
temperamental this week and might have some downtime next week to fix
that. )




So to try out this, feel free to grab the JAR from :

http://build.mygrid.org.uk/ci/job/jena-bundle/21/org.apache.jena$jena-osgi/
or
http://repository.mygrid.org.uk/artifactory/ext-snapshot-local/org/apache/jena/jena-osgi/2.12.2-SNAPSHOT/


If you are running outside Maven, you would might also need to add
additional bundles:

* org.apache.httpcomponents:httpclient-osgi:jar:4.2.6
* org.apache.httpcomponents:httpcore-osgi:jar:4.2.5
* com.fasterxml.jackson.core:jackson-core:jar:2.3.3
* com.fasterxml.jackson.core:jackson-databind:jar:2.3.3
* com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0
* org.apache.commons:commons-csv:jar:1.0
* org.apache.thrift:libthrift:jar:0.9.1
* org.apache.commons:commons-lang3:jar:3.1
* org.slf4j:jcl-over-slf4j:jar:1.7.6
* org.slf4j:slf4j-api:jar:1.7.6
* org.slf4j:slf4j-log4j12:jar:1.7.6
* log4j:log4j:jar:1.2.17

or, add to your pom.xml:

<dependencies>
<dependency>
  <groupId>org.apache.jena</groupId>
  <artifactId>jena-osgi</artifactId>
  <version>2.12.2-SNAPSHOT</version>
</dependency>
</dependencies>

<repositories>
  <repository>
      <id>mygrid.ext-snapshot-local</id>
      <name>Apache Release Distribution Repository</name>
      <url>http://repository.mygrid.org.uk/artifactory/ext-snapshot-local/</url>
      <releases/>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
  </repository>
</repositories>

(Maven should then pull in the remaining dependencies automatically)


Note that you would in effect be testing Jena libraries version
2.12.2-SNAPSHOT - so if something is weird, verify it is caused by the
jena-osgi bundle or by Jena 2.12.2-SNAPSHOT. :)

This might brake at a later stage as jena-parent in Apache's snapshot
repository does not (yet) have ${ver.thrift} defined -- this only
works if the taverna-parent comes from mygrid.ext-snapshot-local.
(For now, try mvn install -U to force update the parent).