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

Compare with Current View Page History

« Previous Version 6 Next »

On this page, we are going to create a service assembly .

Using a Maven archetype to create the service assembly

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

 
c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-service>mvn archetype:create -Darchetyp
eGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-service-
assembly -DgroupId=org.apache.servicemix.examples -DartifactId=my-cxf-sa

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

[INFO] Scanning for projects...
...
[INFO] OldArchetype created in dir: c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-ser
vice\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 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.

 
<project>
  ...
  <name>CXF WSDL Tutorial :: CXF 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.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 output:

 

Now, we are ready to deploy our service assembly.

Things to remember

  • Add SU to your SA by adding dependencies to your pom.xml



  • No labels