Creating an OSGi bundle for deploying JBI endpointsPage edited by Gert VanthienenChanges (4)
Full ContentThis page explains how you can create an OSGi bundle that contains both Java code and a Spring XML file with the endpoints definition. The example shows a file poller endpoint with a servicemix-bean POJO Creating the Maven projectFirst, create and empty directory and add the following pom.xml file. We add the bundle plugin and configure it to import the servicemix-file and servicemix-bean packages as well as the org.apache.servicemix.common.osgi package
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.servicemix</groupId> <artifactId>osgi-sample</artifactId> <packaging>bundle</packaging> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.apache.servicemix</groupId> <artifactId>servicemix-bean</artifactId> <version>2011.01</version> </dependency> </dependencies> <build> <plugins> <!-- configure the bundle plugin with some additional imports --> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.3.4</version> <extensions>true</extensions> <configuration> <instructions> <Import-Package> org.apache.servicemix.file,org.apache.servicemix.bean,org.apache.servicemix.common.osgi,* </Import-Package> </instructions> </configuration> </plugin> <!-- let's use Java 5 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> </plugins> </build> </project>
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
