Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First, 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

Info
titleComponents version

When you're running this example, make sure to configure the correct component version in your pom.xml file
e.g. for ServiceMix 4.3.0, choose the 2011.01 version

Code Block
xml
xml
<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>2009<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.03.0<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>

...