You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

JBI logically separates Binding Components and Service Engines as two flavours of a component, the Maven JBI tooling provides that you can define a project as a jbi-component and then specify whether it is a service-engine or binding-component. Like the shared libraries we have just covered the definition of a jbi-component firstly requires the steps from Getting Started (plugin repositories and plugin) and then it also requires you change the packaging of your project.

<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>MyBindingComponent</artifactId>
  <packaging>jbi-component</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>An example binding component</name>
  ...
</project>

Since a binding component or service engine has more settings than can be derived from your Maven POM.xml we also need to update the plugin section we added to configure these additional settings:

<plugin>
  <groupId>org.apache.servicemix.tooling</groupId>
  <artifactId>jbi-maven-plugin</artifactId>
  <extensions>true</extensions>
  <configuration>
    <type>binding-component</type>
    <bootstrap>org.apache.servicemix.MyBootstrap</bootstrap>
    <component>org.apache.servicemix.MyComponent</component>
  </configuration>
</plugin>

The parameters allow you to specify the following :

type - whether this is a binding-component or a service-engine
bootstrap - the name of the class that will be your bootstrap implementation
component - the name of the class that will be your component implementation

Once you have configured these steps you can run mvn install and much like the shared library maven will create both a standard jar and also a component installer.  If you have a locally running Apache ServiceMix instance (which its default settings) you can even use the plugin to install the Component by simply typing:

mvn jbi:installComponent

This will call the ANT tasks from within Maven giving the component to install as the one built in the install phase.

  • No labels