tree: 05bcc8c8ec4d53287e9f3d3400b5766089202489 [path history] [tgz]
  2. pom.xml
  3. src/

Apache Karaf Branding Example


You can change the look‘n feel (branding) of the Karaf shell console to provide your own Karaf distribution. It’s also possible to brand the Karaf SSH shell.

To do so, you have two solutions:

  • Provide a file in the Karaf etc folder.
  • Provide a bundle providing the branding

Using etc/ file

It's probably the easiest way to customize the Karaf shell console.

The basically contains the “welcome message” or “message of the day” (displayed when Karaf starts).

NB: It's also possible to configure the shell prompt in the prompt property in etc/shell.init.script.

For instance, the following

welcome = \
\u001B[1m  My Lovely Apache Karaf Branding\u001B[0m (x.x.x)\n\
Hit '\u001B[1m<tab>\u001B[0m' for a list of available commands\n\
   and '\u001B[1m[cmd] --help\u001B[0m' for help on a specific command.\n

Note here the using of the ASCII code (\u001B[1m) allowing you to use bold, italic, color, ... text in the shell console.

The only drawback of this approach is the is “visible” and can be changed by an end-user.

The second solution using a bundle allows you to “hide” the file.

## Using branding bundle

This example also provides a branding bundle wrapping the file.

A branding bundle has to wrap a org.apache.karaf.branding package containing the file.


The karaf-branding-example bundle is the one providing our custom branding properties file.

### Build

To build the karaf-branding-example bundle, you just have to do:

mvn clean install


The karaf-branding-example bundle has to be part of the startup bundles. You have two ways to register your custom branding bundle:

  1. You can define the karaf-branding-example bundle URL (mvn:org.apache.karaf.examples/karaf-branding-example/LATEST) in the etc/ file.
  2. You can create your own custom profile (see profile example for detail), defining karaf-branding-example bundle URL (bundle.mvn\:org.apache.karaf.examples/karaf-branding-example/LATEST = mvn:org.apache.karaf.examples/karaf-branding-starter/LATEST) in the etc/profile.cfg file.