Search

Mark Ashworth

Designing applications, writing, photography and reading

Category

OSGi

Installing Apache Karaf features behind a firewall

Apache Karaf can either use :-

  • the proxy settings in the Maven settings.xml in the specific user’s .m2 directory running the Karaf instance
  • the proxy settings in the global settings.xml in the conf directory of the Maven installation
  • the mvn repository can be changed within Karaf to include a local Maven repository like Sonatype Nexus

To use the settings.xml file, specify the following in the file in the global conf directory or in the user’s .m2 directory.

<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>username</username>
<password>password*</password>
<host>hostname or ip</host>
<port>port</port>
<nonProxyHosts>localhost|127.0.0.1|10.0.0.3|10.0.0.4</nonProxyHosts>
</proxy>
</proxies>

The approach that I prefer is to add the Sonatype Nexus public url to the list of repositories that Apache Karaf should use when resolving features. This allows all the developers in a team to utilize the same shared resource for resolving artifacts. Open the ${karaf install folder}\etc\org.ops4j.pax.url.mvn.cfg file and add the url to the org.ops4j.pax.url.mvn.repositories config item.

org.ops4j.pax.url.mvn.repositories= \
http://localhost:9091/nexus/content/groups/public, \
http://repo1.maven.org/maven2@id=central, \
http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, \
https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases, \
file:${karaf.home}/${karaf.default.repository}@id=systemrepo, \
file:${karaf.data}/kar@id=karrepos@multi

Advertisements

OSGi enabled LMAX Disruptor

A friend of mine,John Steinberg, introduced me to the high performance currency framework LMAX Disruptor. In a recent project I wanted to use the Disruptor as an OSGi bundle that my application could make use of but the MANIFEST.MF supplied with the library just contained the default build information.

I have contributed a patch that adds the relevant bundle information, but if you would like LMAX Disruptor 2.9 built library with the OSGi information then have a look here. I did get confirmation from the LMAX Disruptor developers that the patch has been committed and will be available in the next release.

Below is a screen shot of Apache Karaf with the LMAX Disruptor deployed.

Apache Karaf showing deployed Disruptor bundle

Blog at WordPress.com.

Up ↑