Wednesday, August 4, 2010

Re-Branding Karaf Shell Console

Various people have requested that we post some sort of demo or guide to re-branding Apache Karaf shell console, so in this post I'm going to do just that.
The process for branding the shell console is relatively simple, all that is required is a branding jar which contains the new branding in a properties file and some edits to the Karaf etc/ file.

To start we will create a new directory 'branding' and in that folder create a simple pom file that will build our branding jar. The important entry is to export 'org.apache.karaf.branding' in our jar.
We will then create a source directory structure to contain our new branding. The branding itself is kept in a '' file. This is a text file which contains some mark ups for text appearance. The basic layout would be 'src/main/resources/org/apache/karaf/branding/'.

After completing the above two steps your branding project should have the following layout:


To build the branding jar type 'mvn install'.

To deploy the new branding copy the branding jar inside of the target folder to $KARAF_HOME/lib.

Finally to enable Karaf to use this new branding jar you'll have to edit $KARAF_HOMR/etc/ to include the following entry:

org.osgi.framework.system.packages.extra = \
org.apache.karaf.branding; \; \; \; \

The demo described above has been included in trunk and should appear in the next release of Karaf.

No comments: