FUSE ESB requires that all service units be bundled into a service assembly before they can be deployed into a container. The FUSE ESB Maven plug-in will collect all of the service units to be bundled and the metadata needed for packaging. It will then build a service assembly containing the service units.
FUSE ESB provides a Maven artifact for seeding a service assembly project. You can seed a
project with the smx-arch command. As shown in Example C.8, the
smx-arch command takes two arguments. The groupId
value and the
artifactId
values correspond to the project's group ID and artifact ID.
Example C.8. Maven Archetype Command for Service Assemblies
smx-arch
sa ["-DgroupId=my.group.id
"] ["-DartifactId=my.artifact.id
"]
![]() | Important |
---|---|
The double quotes(") are required when using the |
You configure the Maven plug-in to package the results of the project build as a service
assembly by changing the value of the project's packaging
element to jbi-service-assembly
as shown in Example C.9.
Example C.9. Configuring the Maven Plug-in to Build a Service Assembly
<project ...>
<modelVersion>4.0.0</modelVersion>
...
<groupId>com.widgets.demo.cxf-wsdl-first</groupId>
<artifactId>cxf-wsdl-first-sa</artifactId>
<name>CXF WSDL Fisrt Demo :: Service Assembly</name>
<packaging>jbi-service-assembly</packaging>
...
</project>
The Maven plug-in needs to be told what service units are being bundled into the service assembly. You do this by specifying
the service units as a dependencies using the standard Maven dependencies
element. You add a
dependency
child element for each service unit. Example C.10 shows
configuration for a service assembly that bundles two service units.
Example C.10. Specifying the Target Components for a Service Unit
... <dependencies> <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfse-wsdl-first-su</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfbc-wsdl-first-su</artifactId> <version>1.0</version> </dependency> </dependencies> ...
Example C.11 shows the POM file for a project building a service assembly.
Example C.11. POM for a Service Assembly 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.demo</groupId> <artifactId>cxf-wsdl-first</artifactId> <version>1.0</version> </parent> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxf-wsdl-first-sa</artifactId> <name>CXF WSDL Fisrt Demo :: Service Assemby</name> <packaging>jbi-service-assembly</packaging>
<dependencies>
<dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfse-wsdl-first-su</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>com.widgets.demo.cxf-wsdl-first</groupId> <artifactId>cxfbc-wsdl-first-su</artifactId> <version>1.0</version> </dependency> </dependencies> <build> <plugins> <plugin>
<groupId>org.apache.servicemix.tooling</groupId> <artifactId>jbi-maven-plugin</artifactId> <extensions>true</extensions> </plugin> </plugins> </build> </project>
The POM in Example C.11 does the following:
Specifies that it is a part of the top-level project described in Example C.2. | |
Specifies that this project builds a service assembly. | |
Specifies the service units the service assembly bundles. | |
Specifies that the FUSE ESB Maven plug-in is to be used. |