Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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>MyBindingComponent<<artifactId>MyHttpServiceUnit</artifactId>
  <packaging>jbi-service-unit</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>An<name>A exampleservice binding component<unit</name>
  ...
</project>

A Service Unit is assigned to a component and there are couple of ways you can do this using the tooling, the best way to do this is to actually add the component as a dependency, as shown below for the ServiceMix HTTP component:

Code Block
xml
xml
<dependencies>        
    <dependency>
       <groupId>org.apache.servicemix</groupId>
       <artifactId>servicemix-http</artifactId>
       <version>3.0-incubating-SNAPSHOT</version>            
    </dependency>
</dependencies>

...

Once you have configured these steps you can run mvn install and you should find that both a jar and zip version of the service unit are created, this is to allow you to reference the SU as a dependency on the Service Assembly.

...

...


Maven Log - Missing

Remember that a Service Unit is pretty useless outside a Service Assembly

The maven plugin will generate the ServiceUnit jbi descritor if the component contains a ServiceUnitAnalyzer. In some cases, the ServiceUnitAnalyzer may fail to create the needed informations and generate an exception (if the service unit requires some runtime dependencies, such as JNDI objects for example). When such a problem happen, you can disable the jbi.xml generation by using the following configuration:

Code Block
lakngxml

<plugin>
  <groupId>org.apache.servicemix.tooling</groupId>
  <artifactId>jbi-maven-plugin</artifactId>
  <version>1.0-incubating-SNAPSHOT</version>
  <extensions>true</extensions>
  <configuration>
    <useServiceUnitAnalyzer>false</useServiceUnitAnalyzer>
  </configuration>
</plugin>