LibraryLink ToToggle FramesPrintFeedback

Setting Up a FUSE ESB JBI Project

When working with the FUSE ESB JBI Maven tooling, you will want to create a top-level project that can build all of the service units and package them into a service assembly. Using a top-level project for this purpose has several advantages. It allows you to control the dependencies for all of the parts of an application in a central location. It limits the number of times you need to specify the proper repositories to load. It also gives you a central location from which to build and deploy the application.

The top-level project is responsible for assembling the application. It will use the Maven assembly plug-in and list your service units and the service assembly as modules of the project.

Your top-level project will contain the following directories:

In order to use the FUSE ESB JBI Maven tooling, you add the elements shown in Example C.1 to your top-level POM file.


These elements point Maven to the correct repositories to download the FUSE ESB Maven tooling and load the plug-in that implements the tooling.

Your top-level POM lists all of the service units and the service assembly that will be generated as modules. The modules are contained in a modules element. The modules element contains one module element for each service unit in the assembly. You will also need a module element for the service assembly.

The modules should be listed in the order in which they are built. This means that the service assembly module should be listed after all of the service unit modules.

Example C.2 shows a top-level pom for a project that contains a single service unit.

Example C.2. Top-Level POM for a FUSE ESB JBI 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>

  <parent>
    <groupId>com.widgets</groupId>
    <artifactId>demos</artifactId>
    <version>1.0</version>
  </parent>

  <groupId>com.widgets.demo</groupId>
  <artifactId>cxf-wsdl-first</artifactId>
  <name>CXF WSDL Fisrt Demo</name>
  <packaging>pom</packaging>
    
  <pluginRepositories> 1
    <pluginRepository>
      <id>fusesource.m2</id>
      <name>FUSE Open Source Community Release Repository</name>
      <url>http://repo.fusesource.com/maven2</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </pluginRepository>
  </pluginRepositories>
  <repositories>
    <repository>
      <id>fusesource.m2</id>
      <name>FUSE Open Source Community Release Repository</name>
      <url>http://repo.fusesource.com/maven2</url>
      <snapshots>
         <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
      </releases>
    </repository>
    <repository>
      <id>fusesource.m2-snapshot</id>
      <name>FUSE Open Source Community Snapshot Repository</name>
      <url>http://repo.fusesource.com/maven2-snapshot</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>
    
  <modules> 2
    <module>wsdl-first-cxfse-su</module>
     <module>wsdl-first-cxf-sa</module>
  </modules>
    
  <build>
    <plugins>
      <plugin> 3
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
         <version>2.1</version>
         <inherited>false</inherited>
           <executions>
             <execution>
                <id>src</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>src/main/assembly/src.xml</descriptor>
                  </descriptors>
                 </configuration>
               </execution>
             </executions>
           </plugin>
           <plugin> 4
             <groupId>org.apache.servicemix.tooling</groupId>
             <artifactId>jbi-maven-plugin</artifactId>
             <extensions>true</extensions>
           </plugin>
    </plugins>
  </build>
</project>

The POM shown in Example C.2 does the following:

1

Configures Maven to use the FUSE repositories for loading the FUSE ESB plug-ins.

2

Lists the sub-projects used for this application. The wsdl-first-cxfse-su module is the module for the service unit. The wsdl-first-cxf-sa module is the module for the service assembly

3

Configures the Maven assembly plug-in.

4

Loads the FUSE ESB JBI plug-in.