You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

We are now going to use the Maven JBI plugin to deploy the service assembly

Deploy the SA

Before you start, make sure that you have started ServiceMix.

Now, navigate to your project's SA directory and use the JBI Maven plugin to deploy your project.

cd tutorial-sa
mvn jbi:projectDeploy

Upon successful deployment, we get this output:

Scanning for projects...
[INFO] ----------------------------------------------------------------------------
[INFO] Building Tutorial :: SA
[INFO]    task-segment: [jbi:projectDeploy]
[INFO] ----------------------------------------------------------------------------
       ...
[INFO] [jbi:projectDeploy]
       ...
[INFO] Deploying jbi-service-assembly from /home/gert/.m2/repository/org/apache/servicemix/tutorial/tutorial-sa/1.0-SNAPSHOT/tutorial-sa-1.0-SNAPSHOT.zip
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
       ...

What happens here? First of all, the Maven plugin will analyze your service assembly to determine what needs to be done. In this case, it determines that the service assembly we created requires the servicemix-file JBI component, which requires the standard ServiceMix shared library. This is shown in the output from the command:

[INFO] [jbi:projectDeploy]
[INFO] ------------------ Deployment Analysis --------------------
[INFO] Tutorial :: SA has 2 child dependencies
[INFO]  - jbi-service-assembly : /home/gert/.m2/repository/org/apache/servicemix/tutorial/tutorial-sa/1.0-SNAPSHOT/tutorial-sa-1.0-SNAPSHOT.zip
[INFO]  - jbi-component : /home/gert/.m2/repository/org/apache/servicemix/servicemix-file/3.1.1-incubating/servicemix-file-3.1.1-incubating-installer.zip
[INFO]  - jbi-shared-library : /home/gert/.m2/repository/org/apache/servicemix/servicemix-shared/3.1.1-incubating/servicemix-shared-3.1.1-incubating-installer.zip
[INFO] -----------------------------------------------------------

Next, the process connects to the running ServiceMix instance to determine what has already been installed/deployed. In the example below, the servicemix-file JBI component and the servicemix-shared shared library were already installed, but the service assembly still needs to be deployed. If you run the same command on a freshly installed ServiceMix instance, all dependencies will get installed/deployed automatically.

[INFO] [jbi:projectDeploy]
       ... 
[INFO] servicemix-shared is deployed
[INFO] servicemix-file is deployed
[INFO] tutorial-sa is not deployed
[INFO] Deploying jbi-service-assembly from /home/gert/.m2/repository/org/apache/servicemix/tutorial/tutorial-sa/1.0-SNAPSHOT/tutorial-sa-1.0-SNAPSHOT.zip
       ...

Test the service assembly

We configured our file SU to poll for files and send them to another directory. Just copy any XML file into the directory you configured in the file:poller endpoint and ServiceMix will automatically move it to the directory configured in the sender endpoint after a few seconds.

Next, we are going to start using what we have learned by adding two other SU to our SA.

Things to remember

  • You can run the mvn jbi:projectDeploy command from the SA directory in your project
  • Make sure you have ServiceMix running on the same machine before runnning this command
  • The command will not only deploy the service assembly, but also install any dependencies automatically



  • No labels