Versions Compared

Key

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

...

Using a Maven archetype, we will create a simple project whose job is to simply bundle up other project. Below is the command to create the SA Maven project. You may replace the -DarchetypeVersion with whatever ServiceMix version you are using:

No Formatcode
$ [SMX_HOME]/bin/mvnsmx-arch sa
  -DgroupId=com.mycompany \
  -DartifactId=my-sa

...

This information was gleaned from the my-consumer-su pom.xml file in the What is a JBI SU and how do I create one? FAQ entry. Now that we have a SU listed as a dependency, it's time to build and package the SA. Below is the Maven command to do this:

No Formatcode
$ mvn install 

You will need to have Maven 2.0.4 or higher installed in order to run this command. This packages up the my-consumer-su SU inside of the my-sa SA and places the my-sa build artifact in the target directory.

...

Notice that the SA archive contains not only the required META-INF/jbi.xml file, but also the included my-consumer-su-1.0-SNAPSHOT.zip file. The META-INF/jbi.xml file was generated by the JBI Maven plugin. Below is the contents of this file:

noformat
Code Block
xml
xml
$ cat ./target/my-sa-1.0-SNAPSHOT-installer/META-INF/jbi.xml 
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
  <service-assembly>
    <identification>
      <name>my-sa</name>
      <description>A custom project</description>
    </identification>
    <service-unit>
      <identification>
        <name>my-consumer-su</name>
        <description>my-consumer-su</description>
      </identification>
      <target>
        <artifacts-zip>my-consumer-su-1.0-SNAPSHOT.zip</artifacts-zip>
        <component-name>servicemix-http</component-name>
      </target>
    </service-unit>
  </service-assembly>

...

To deploy the SA to ServiceMix, simply copy the SA JAR/ZIP file from the target directory to the ServiceMix deploy directory. The deployer should automatically pick up the SA and output some logging to both the console and the data/log/servicemix.log file as the deployment takes place to let you know what is happening. You can also get more detail about the deployment by increasing the log level in the conf/log4j.xml file from INFO to DEBUG. For more information on ServiceMix logging, see How do I change the logging.

Additional Information

Have you walked through the Tutorials yet? This is a great place to start if you're new to JBI.