Splitted the OSGi bundle creation from the broker jar to let the broker be executable also outside of a container

This commit is contained in:
selva.andre
2014-02-08 17:59:36 +01:00
parent a1448597af
commit 95d276f7a0
6 changed files with 256 additions and 16 deletions
+1
View File
@@ -12,3 +12,4 @@ parser_commons/target/
distribution/target/
broker/moquette.log
broker/runner
/bundle/target/
+16 -16
View File
@@ -11,7 +11,7 @@
</parent>
<artifactId>moquette-broker</artifactId>
<packaging>bundle</packaging>
<packaging>jar</packaging>
<!--<version>${moquette-version}</version>-->
<name>Moquette - broker</name>
@@ -43,14 +43,14 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
@@ -76,35 +76,35 @@
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
@@ -118,7 +118,7 @@
<groupId>org.fusesource.hawtdb</groupId>
<artifactId>hawtdb</artifactId>
<version>1.6</version>
<scope>provided</scope>
<!--<scope>provided</scope>-->
</dependency>
<dependency>
@@ -172,7 +172,7 @@
</configuration>
</plugin>
<plugin>
<!-- <plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
@@ -196,21 +196,21 @@
</configuration>
</plugin>
<plugin>
<!-- Pax Runner Maven plugin -->
Pax Runner Maven plugin
<groupId>org.ops4j</groupId>
<artifactId>maven-pax-plugin</artifactId>
<version>1.4</version>
<configuration>
<!-- Pax Runner version -->
Pax Runner version
<runner>1.4.0</runner>
<!-- OSGi framework type (equinox, felix, knopflerfish) -->
OSGi framework type (equinox, felix, knopflerfish)
<framework>equinox</framework>
<provision>
<!-- <param> - -log=debug</param>
<param> - -workingDirectory=target/runner</param> -->
<param> - -log=debug</param>
<param> - -workingDirectory=target/runner</param>
</provision>
</configuration>
</plugin>
</plugin>-->
</plugins>
</build>
+8
View File
@@ -0,0 +1,8 @@
Simple guide on how to use the bundle in a testable OSGi container:
- mvn pax:provision //to create and download the required bundles
- osgi>exit
- cp target/moquette-bundle-0.5-SNAPSHOT.jar runner/bundles/ //to move the broker bundle
- mvn pax:provision //restart the OSGi container
- osgi> install file:bundles/moquette-bundle-0.5-SNAPSHOT.jar
- osgi> ss
- osgi> start <num last bundle>
+230
View File
@@ -0,0 +1,230 @@
<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>
<relativePath>../</relativePath>
<!--<relativePath>../pom.xml</relativePath>-->
<artifactId>moquette-parent</artifactId>
<groupId>org.dna.mqtt</groupId>
<version>0.5-SNAPSHOT</version>
</parent>
<artifactId>moquette-bundle</artifactId>
<packaging>bundle</packaging>
<!--<version>${moquette-version}</version>-->
<name>Moquette - OSGi bundle</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.dna.mqtt</groupId>
<artifactId>moquette-parser-commons</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.dna.mqtt</groupId>
<artifactId>moquette-netty-parser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.dna.mqtt</groupId>
<artifactId>moquette-broker</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.googlecode.disruptor</groupId>
<artifactId>disruptor</artifactId>
<version>2.7.1</version>
<!--<version>3.2.0</version>-->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.compendium</artifactId>
<version>1.0.0</version>
</dependency>
<!-- Included to embedded an HawtDB dependency, we host commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>4.0.8.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.fusesource.hawtbuf</groupId>
<artifactId>hawtbuf</artifactId>
<version>1.9</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.fusesource.hawtdb</groupId>
<artifactId>hawtdb</artifactId>
<version>1.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- needs extra dependencies: objenesis & hamcrest -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fusesource.mqtt-client</groupId>
<artifactId>mqtt-client</artifactId>
<version>1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>mqtt-client</artifactId>
<version>0.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>org.dna.mqtt.commons,
org.apache.commons.logging,
org.dna.mqtt.moquette.messaging.spi.impl.storage,
org.dna.mqtt.moquette.messaging.spi.impl.subscriptions,
org.dna.mqtt.moquette.proto.messages,
org.dna.mqtt.moquette.server.netty.metrics
</Export-Package>
<Private-Package>org.dna.mqtt.moquette.bundle,
${project.groupId}.*,
com.lmax.*
</Private-Package>
<Import-Package>*</Import-Package>
<Bundle-Activator>${project.groupId}.moquette.bundle.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
<plugin>
<!-- Pax Runner Maven plugin -->
<groupId>org.ops4j</groupId>
<artifactId>maven-pax-plugin</artifactId>
<version>1.4</version>
<configuration>
<!-- Pax Runner version -->
<runner>1.4.0</runner>
<!-- OSGi framework type (equinox, felix, knopflerfish) -->
<framework>equinox</framework>
<provision>
<!-- <param> - -log=debug</param>
<param> - -workingDirectory=target/runner</param> -->
</provision>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>Paho Releases</id>
<url>https://repo.eclipse.org/content/repositories/paho-releases/</url>
</repository>
</repositories>
</project>
+1
View File
@@ -20,6 +20,7 @@
<module>netty_parser</module>
<module>broker</module>
<module>distribution</module>
<module>bundle</module>
</modules>
<reporting>