Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Creating the service assembly (SA)

Wiki Markup
{scrollbar}

On this page, we are going to

Excerpt

create a service assembly

.

...

ServiceMix provides Maven archetype to help you create your service assembly.(SA)
Run this command from the directory folder that holds contains your parent root pom.xml:

No Format
 
c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-service>mvnmvn archetype:create -Darchetyp
eGroupIdDarchetypeGroupId=org.apache.servicemix.tooling 
                     -DarchetypeArtifactId=servicemix-service-
assemblyassembly 
                     -DgroupId=org.apache.servicemix.examples 
                     -DartifactId=my-cxf-sa

Maven executes the archetype and reports BUILD SUCCESSFUL when it's done.

No Format
[INFO] Scanning for projects...
...
[INFO] OldArchetype created in dir: c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-ser
viceservice\my-cxf-sa
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43 seconds
[INFO] Finished at: Tue Aug 05 09:29:11 CEST 2008
[INFO] Final Memory: 10M/18M
[INFO] ------------------------------------------------------------------------

Configuring the pom.xml

Changing the project name

In order to make the build output a little bit more comprehensible , we first change the project name in the generated pom.xml file.

No Format
 
<project>
  ...
  <name>CXF WSDL Tutorial :: CXF SA</name>
  ...
</project>

Adding the

...

all service units to the

...

assembly

We want to add the service unit units 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:

No Format
 
<project>
  ...
  <dependencies>
  <dependency>
      <groupId>org.apache.servicemix.examples</groupId>
      <artifactId>my-cxf-se-su</artifactId>
      <version>1.0-SNAPSHOT</version>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.examples</groupId>
      <artifactId>my-cxf-bc-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 outputproject's root folder to build all service units and to create
the service assembly:

No Format
 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] ServiceMix :: tutorial-wsdl-cxf-service ............... SUCCESS [3.031s]
...
[INFO] CXF WSDL Tutorial :: CXF SA ........................... SUCCESS [1.265s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 minutes 47 seconds
[INFO] Finished at: Tue Aug 05 09:44:23 CEST 2008
[INFO] Final Memory: 38M/69M
[INFO] ------------------------------------------------------------------------

Now, we are ready to deploy our service assembly. For doing this we just copy the created service assembly jar zip file (my-cxf-sa/target/my-cxf-sa-1.0-SNAPSHOT.jarzip) into the hotdeploy folder of your ServiceMix installation. Watch the service mix servicemix console window for success (or maybe errors).

...

  • You can use the servicemix-service-assembly archetype to quickly create a Maven SA project.
  • Add SU to your SA by adding dependencies to your pom.xml

Proceed to the next step



Wiki Markup
{scrollbar}