Skip to content

Instantly share code, notes, and snippets.

A little journey into Karaf

Recently, I took some existing OSGi bundles that had never been used with Karaf, and use them to build a web service in Karaf. These notes record some of the pitfalls that I encountered.

From Bundles to Features

The first step in Karaf deployment is to create features. At first blush, making features is trivial:

@bimargulies
bimargulies / pom.xml
Created July 23, 2015 20:51
karaf 4.0.0 pom attempt
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>anvils-prototype</artifactId>
<groupId>com.basistech.ws</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>karaf-rest-service</artifactId>
<packaging>kar</packaging>
@bimargulies
bimargulies / pom.xml
Created July 23, 2015 19:27
problems with maven and karaf
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>anvils-prototype</artifactId>
<groupId>com.basistech.ws</groupId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>karaf-rest-service</artifactId>
@bimargulies
bimargulies / console log
Last active August 29, 2015 14:06
maven-release-plugin debugging
[INFO] Executing goals 'clean verify'...
[WARNING] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
[INFO] [INFO] Scanning for projects...
[INFO] [INFO]
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO] Building pom-file-name-tc-second 0.0.6
[INFO] [INFO] ------------------------------------------------------------------------
[INFO] [INFO]
[INFO] [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ pom-file-name-tc-second ---
[INFO] [INFO] ------------------------------------------------------------------------