Versions Compared

Key

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

Creating the cxf-se service unit

Wiki Markup
{scrollbar}

On this page, we are going to

Excerpt

create the 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 our tutorial's project directory, where we already have the parent pom.xml, we run this folder we run the following command to create a service unit project.:

No Format
 
c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-service>mvnmvn archetype:create -Darchetyp
eGroupIdDarchetypeGroupId=org.apache.servicemix.tooling 
                     -DarchetypeArtifactId=servicemix-cxf-se-s
ervice-unitservice-unit 
                     -DgroupId=org.apache.servicemix.examples 
                     -DartifactId=my-cxf-se-su

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

No Format
 
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO]   ServiceMix :: tutorial-wsdl-cxf-service
[INFO]   A Cxf BC Service Unit
[INFO] Searching repository for plugin with prefix: 'archetype'.
...
[INFO] OldArchetype created in dir: c:\home\Diplomka\_mySA\tutorial-wsdl-cxf-ser
viceservice\my-cxf-se-su
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Tue Aug 05 08:16:57 CEST 2008
[INFO] Final Memory: 10M/18M
[INFO] ------------------------------------------------------------------------

...

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

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

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

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

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

Proceed to the next step



Wiki Markup
{scrollbar}