With the tutorial-first-su ready, we are now ready to create a service assembly and deploy it
Creating the service assembly (SA)
Just as we started our service unit with a Maven archetype, we are also going to use a Maven archetype (servicemix-service-assembly) to create the SA project. Run this command from the directory that holds your parent pom.xml:
A new service assembly project is generated in the tutorial-sa directory.
Editing pom.xml
Changing the project name
Again, to clean up the build output, we change the project's name
<?xml version="1.0" encoding="UTF-8"?>
<project>
...
<name>Tutorial :: SA</name>
...
</project>
Adding the SU to the SA
We want to add the service unit we created before to the service assembly. The Maven tooling will do this automatically if we add the correct dependency to our SA's pom.xml. We just use the groupId, artifactId and version we find in our service unit's pom.xml here:
<project>
...
<dependencies>
<dependency>
<groupId>org.apache.servicemix.tutorial</groupId>
<artifactId>tutorial-file-su</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
...
</project>
Running Maven to build everything
Now, run mvn install from the parent directory to get this output: