LibraryLink ToToggle FramesPrintFeedback

Chapter 7. Building JBI Components Using Maven

Fuse ESB provides Maven tooling that simplifies the creation and deployment of JBI artifacts. Among the tools provided are:

The Fuse ESB Maven tools also include plug-ins for creating service units and service assemblies. However, those plug-ins are not described in this book.

In order to use the Fuse ESB Maven tools, you add the elements shown in Example 7.1 to your POM file.


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

The Fuse ESB Maven tools provide a number of archetypes that can be used to seed a JBI project. The archetype generates the proper file structure for the project along with a POM file that contains the metadata required for the specified project type.

Example 7.2 shows the command for using the JBI archetypes.


The value passed to the -DarchetypeArtifactId argument specifies the type of project you are creating.

As shown in Example 7.3, you specify a value of jbi-component for the project's packaging element, which informs the Fuse ESB Maven tooling that the project is for a JBI component.


The plugin element responsible for packaging the JBI component is shown in Example 7.4. The groupId element, the artifactId element, the version element, and the extensions element are common to all instances of the Fuse ESB Maven plug-in. If you use the Maven archetypes to generate the project, you should not have to change them.


The configuration element, along with its children, provides the Fuse ESB tooling with the metadata necessary to construct the jbi.xml file required by the component.

Once the project is properly configured, you can build the JBI component by using the mvn install command. The Fuse ESB Maven tooling will generate a standard jar containing both the component and an installable JBI package for the component.

As shown in Example 7.5, to instruct the Fuse ESB Maven tooling that the project is for a shared library you specify a value of jbi-shared-library for the project's packaging element.


You build the shared library using the mvn install command. The Fuse ESB Maven tooling generates a standard jar containing the shared library and an installable JBI package for the shared library.