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

Compare with Current View Page History

« Previous Version 14 Next »

ServiceMix provides a set of Maven archetypes for many different purposes, such as for creation of JBI components, service assemblies or service units for particular ServiceMix components.

Usage

Standard Maven syntax

You can utilize an archetype by issueing the following command:

mvn archetype:create \
    -DarchetypeGroupId=org.apache.servicemix.tooling \
    -DarchetypeArtifactId=servicemix-archetype-name \
    -DgroupId=org.apache.servicemix.samples.embedded \
    -DartifactId=servicemix-embedded-example

You need to replace servicemix-archetype-name by the name of the archetype you want to utilize. This will use the latest released version of the archetype available in the repository. Optionally, you can also specify a specific version to use with the -DarchetypeVersion=VERSION parameter.

If you are using an *-incubating version of ServiceMix (e.g. 3.1.1-incubating), you have to either:

smx-arch

ServiceMix also ships with smx-arch (or smx-arch.bat for Windows), available in the bin directory of the distribution. It provides a more convenient way for using the archetypes:

Usage: smx-arch command [su-type] [args]
  commands:
    sl                Creates a new Shared Library"  
    se                Creates a new Service Engine"
    bc                Creates a new Binding Component"
    sa                Creates a new Service Assembly"
    su                Creates a generic Service Unit"
    su [type]         Creates a SU of the specified type"
  SU types:
                      http-consumer, http-provider,"
                      jms-consumer, jms-provider,"
                      ftp-poller, ftp-sender,"
                      jsr181-annotated, jsr181-wsdl-first,"
                      saxon-xquery, saxon-xslt,"
                      eip, lwcontainer, bean, ode"
  Optional arguments:
    -DgroupId=xxxx"
    -DartifactId=xxxx"

List of archetypes

Here is a list of the ServiceMix archetypes that are available. You can also take a look at the current list of available archetypes at http://people.apache.org/maven-snapshot-repository/org/apache/servicemix/tooling/ or in the archetypes directory in a ServiceMix source distribution.

Basic JBI artifact archetypes

There is a specific archetype available for generating every type of JBI artifact. They are named servicemix-binding-component, servicemix-service-assembly, servicemix-service-engine, servicemix-service-unit and servicemix-shared-library.

Service units

Most of the ServiceMix archetypes can be used to create service unit projects. The list above already mentions servicemix-service-unit, which creates a generic SU project. You still have to add a <dependency/> to the pom.xml yourself for the JBI component you want to target.

These other archetypes already generate a SU targeted at a specific component. They also provide an xbean.xml file and sometimes some additional sample files.

archetype

JBI component

contents of xbean.xml

remarks

servicemix-bean-service-unit

servicemix-bean

a bean endpoint definition

also generates a sample class named MyBean

servicemix-camel-service-unit

servicemix-camel

 

deploys a set of Camel EIP routes
(version 3.2 or above only)

servicemix-drools-service-unit

servicemix-drools

a drools endpoint

also generates a sample Drools rule file named router.drl
(version 3.2 or above only)

servicemix-eip-service-unit

servicemix-eip

an example for every EIP supported

 

servicemix-ftp-poller-service-unit

servicemix-ftp

an <ftp:poller/> endpoint

 

servicemix-ftp-sender-service-unit

servicemix-ftp

an <ftp:sender/> endpoint

 

servicemix-http-consumer-service-unit

servicemix-http

some examples of possible HTTP consumer endpoint configurations

 

servicemix-http-provider-service-unit

servicemix-http

some examples of possible HTTP provider endpoint configurations

 

servicemix-jms-consumer-service-unit

servicemix-jms

some examples of possible JMS consumer endpoint configurations

 

servicemix-jms-provider-service-unit

servicemix-jms

some examples of possible JMS provider endpoint configurations

 

servicemix-jsr181-annotated-service-unit

servicemix-jsr181

a JSR-181 annotated POJO endpoint

also generates a sample class named ExampleService

servicemix-jsr181-wsdl-first-service-unit

servicemix-jsr181

a JSR-181 WSDL based endpoint

also generates a sample WSDL file

servicemix-lwcontainer-service-unit

servicemix-lwcontainer

/

the servicemix.xml provided defines a sample lightweight component

servicemix-ode-service-unit

Apache ODE BPEL engine

/

creates a sample BPEL, WSDL and deploy.xml

servicemix-osworkflow-service-unit

OpenSymphony workflow engine

/

creates a sample workflow

servicemix-saxon-xquery-service-unit

servicemix-saxon

examples of all supported (resource, inline and dynamic) ways to XQuery

also generates an example of an XQuery file

servicemix-saxon-xslt-service-unit

servicemix-saxon

examples of static and dynamic XSL-T usage

provides an example of an XSL-T file

  • No labels