-
Notifications
You must be signed in to change notification settings - Fork 11
Roboconf over Karaf 4 guide
Roboconf relies on the Apache Karaf OSGi runtime. For now, the v3.0.3 version is used, but upcoming features will need a version upgrade, such as the use of a WebSocket compatible Web container. This document details how to build Roboconf using the Apache Karaf project, v4.x.
WARNING:
At the time this document is written, the 4.0.0 version of the Apache
Karaf project is not released yet (scheduled for 2015/04/11). The build
steps detailed hereafter are based on SNAPSHOTS versions build from
trunk, which may be unstable.
git clone git://git.apache.org/karaf.git
# or from mirror on GitHub: [email protected]:apache/karaf.git
The Karaf trunk build needs a few additional steps. It relies on several SNAPSHOT maven dependencies, but these dependencies cannot be found in the Maven central repository, or any repository used by the Karaf at build-time. They must be retrieved by hand and installed locally.
The following list details, for each missing dependency, the location where it can be downloaded.
-
org.apache.felix/org.apache.felix.connect/0.1.0-SNAPSHOT
:
This one cannot be found anywhere, so the workaround is to checkout the sources of the Apache Felix project and install the project in the local Maven repository. The javadoc plugin may prevent the build, so it is disabled.
git clone git://git.apache.org/felix.git
# or from mirror on GitHub: [email protected]:apache/felix.git
cd felix/connect
mvn install -Dmaven.javadoc.skip=true
-
org.jolokia/jolokia-osgi/1.2.4-SNAPSHOT
:
Available here (pickup the last timestamped snapshot):
http://labs.consol.de/maven/snapshots-repository/org/jolokia/jolokia-osgi/1.2.4-SNAPSHOT/ -
org.ops4j.pax.cdi/pax-cdi-feature/feature/xml/0.12.0-SNAPSHOT
:
Available here (pickup the last timestamped snapshot):
https://oss.sonatype.org/content/repositories/ops4j-snapshots/org/ops4j/pax/cdi/pax-cdi-features/0.12.0-SNAPSHOT/ - various SpringSource bundles, which are accessible here:
http://ebr.springsource.com/repository/app/net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0
org.hibernate/com.springsource.org.hibernate/3.3.2.GA
org.hibernate/com.springsource.org.hibernate.annotations/3.4.0.GA
org.hibernate/com.springsource.org.hibernate.annotations.common/3.3.0.ga
org.hibernate/com.springsource.org.hibernate.ejb/3.4.0.GA
org.jboss.javassist/com.springsource.javassist/3.9.0.GA
org.objectweb.asm/com.springsource.org.objectwab.asm/1.5.3
All the downloaded bundles must be installed in the local Maven repository, using the following command:
mvn install:install-file \
-Dfile=<path to file> \
-DgroupId=<group id> \
-DartifactId=<artifact id> \
-Dversion=<version> \
-Dqualifier=<qualifier> \
-Dpackaging=<packaging>
Or you can add this profile in your ~/.m2/settings.xml file.
<profile>
<id>karaf</id>
<repositories>
<repository>
<id>Apache Snpashots</id>
<url>https://repository.apache.org/content/groups/snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
<repository>
<id>labs.consol</id>
<url>http://labs.consol.de/maven/snapshots-repository</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
<repository>
<id>OPS4J</id>
<url>https://oss.sonatype.org/content/repositories/ops4j-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
</repositories>
</profile>
Then, add it to your default profiles or use the -P karaf option when you compile Karaf.
mvn -Pfastinstall
... or...
mvn -P fastinstall, karaf
The ZIP and TAR distributions are located under the assemblies directory.
Karaf 4.x has introduced some subtle changes that impact the normal Roboconf
build. Thus, some modifications of the Roboconf build instructions (pom.xml
)
are required. The following fork of the Roboconf platform include those
modifications.
Inside the Roboconf platform source directory, type:
git remote add fork.bourretp [email protected]:bourretp/roboconf-platform.git
git fetch fork.bourretp
git checkout feature/karaf-4-snapshot
and finally…
mvn clean install
Before running Roboconf, you need to fix a bug in the generated distributions.
Well, this is not really a bug in the distribution, but rather a bug in the way
Karaf searches artifacts in its included Maven repository (the one in the
system
directory). The bug concerns the Apache Felix framework artifact, which
is the very base runtime layer of Karaf itself, so the distribution cannot boot
at all.
To resolve this issue, you must rename the Apache Felix framework artifact, so
Karaf can find it. Inside the generated distribution, find the system/org/apache/felix/org.apache.felix.framework/4.9.0-SNAPSHOT/org.apache.felix.framework-4.9.0-<whatever>.jar
file, and replace the <whatever>
part by SNAPSHOT
: org.apache.felix.framework-4.9.0-SNAPSHOT.jar
Note that this fix must be performed on both dm
and agent
distributions.
TODO: automate this task in the distributions' pom.
Now you can safely run Roboconf, flavored with Karaf 4.x:
bin/karaf
For some (yet) unknown reason, the Roboconf (console) branding does not seem to work properly, but this is definitely non-blocking.