Versions Compared

Key

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

...

On this page, we are going to

Excerpt

create our second SU module in our project cxf-se service unit.

.

Using a Maven archetype to create the service unit project

ServiceMix provides several Maven archetypes to help you create your projects more rapidly and reliably. We start off by using the servicemix-cxf-se-service-unit archetype, which is used for creating a servicemix-cxf-se service unit project.

From SMX_HOME/bin directoryour tutorial project directory, where we already have the parent pom.xml, we run this command to create a service unit project named :in MS Windows:.

No Format
 
smx-arch su c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-service>mvn archetype:create -Darchetyp
eGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-cxf-se

in GNU\Linux:

No Format
 
./smx-arch su cxf-se-s
ervice-unit -DgroupId=org.apache.servicemix.examples -DartifactId=my-cxf-se-su

Maven executes the archetype and reports BUILD SUCCESSFUL when it's done. (For more information run smx-arch help)

No Format
 
[INFO] Scanning for projects...
[INFO] Reactor 
c:\java\apache-servicemix-3.2.1\bin>smx-arch su cxf-sebuild order:
[INFO]   ServiceMix :: tutorial-wsdl-cxf-service
[INFO]   A Cxf BC Service Unit
[INFO] ScanningSearching repository for projects... plugin with prefix: 'archetype'.
...
[INFO] OldArchetype created in dir: c:\java\apache-servicemix-3.2.1\bin\home\Diplomka\_mySA\tutorial-wsdl-cxf-ser
vice\my-cxf-s
ese-su
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 211 seconds
[INFO] Finished at: WedTue JulAug 3005 08:5216:2457 CEST 2008
[INFO] Final Memory: 8M10M/14M18M
[INFO] ------------------------------------------------------------------------

Add this SU project to directory of our project

...

-

...

-

...

-

...

No Format
 
  <modules>
     <module>my-cxf-se-su</module>
  </modules>

Finally, parent's pom.xml looks like this:

No Format
 
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.apache.servicemix</groupId>
  <artifactId>myExamples</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>ServiceMix  :: CXF WSDL example</name>
  <url>http://servicemix.org</url>
  <modules>
      <module>my-cxf-se-su</module>
  </modules>
</project>

What is being generated?

First of all, the archetype creates the project directory my-cxf-se-su, containing:

  • a pom.xml file for building the service unit project
  • a directory src/main/resources, in which we will create our where is xbean.xml file for configuring the service unit
  • a directory src/main/java, in which we will create where is com/mycompany/ExampleService.java for implementing our service.

Because we started Maven's archetype:create from the directory containing our parent pom.xml, Maven has also added a module to the parent pom.xml.

No Format
 
 <module>my-cxf-se-su</module>

Now, we will have to configure the service unit to provide the services we want.

...