Versions Compared

Key

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

...

  • Maven 2.0.4 or higher
    • If you have never used Maven previously the Maven Getting Started Guide explains some valuable concepts surrounding Maven
  • ServiceMix 3.1-incubating .2 or higher
  • See the ServiceMix downloads to grab a nightly build as ServiceMix 3.1 has not yet been released
  • A broadband internet connection so Maven can automatically download dependencies

...

Panel

$ mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-service-engine \
-DarchetypeVersion=3.1-incubating .2 \
-DgroupId=org.apache.servicemix.samples.helloworld.se \
-DartifactId=hello-world-se \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-repositoryImage Removed

The command above will create a directory named hello-world-se that houses a Maven project for the JBI service engine being created here. The name of the directory is taken from the artifactId parameter.

The first three parameters to the mvn command (-DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-service-engine -DarchetypeVersion=3.1-incubating.2) identify which Maven archetype to use for the archetype:create goal, while the last two parameters (-DgroupId=org.apache.servicemix.samples.helloworld.se -DartifactId=hello-world-se) uniquely identify the Maven project that is being generated. The groupId is used as the Java package and the artifactId is used as the project name. Therefore, only alphanumeric characters are valid values for the groupId and artifactId parameters. The very last parameter tells Maven to look at the Incubator repository at the ASF. Because Incubator policy disallows incubating projects to publish artifacts outside of the Incubator repository, the remoteRepositories system property tells Maven to use the Incubator repository.

Tip

The value of the archetypeVersion parameter in the command above (3.1-incubating.2) may need to be updated to the current ServiceMix version in order for the command to work correctly. The latest version can always be found in the top level ServiceMix POM in the <version> element.

...

No Format
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:create] (aggregator-style)
[INFO] ----------------------------------------------------------------------------
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] ************************************************************** 
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File: org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated: org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR] ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using  VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: 
Unable to find resource 'VM_global_library.vm'
[INFO] Velocimacro :  VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline will be  global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[INFO] [archetype:create]
[INFO] Defaulting package to group ID: org.apache.servicemix.samples.helloworld.se
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating Archetype: servicemix-service-engine:3.1-incubating.2
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.apache.servicemix.samples.helloworld.se
[INFO] Parameter: packageName, Value: org.apache.servicemix.samples.helloworld.se
[INFO] Parameter: basedir, Value: /Users/bsnyder/src/hello-world-smx
[INFO] Parameter: package, Value: org.apache.servicemix.samples.helloworld.se
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: artifactId, Value: hello-world-se
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 63,column 16] : 
${servicemix-version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 68,column 16] : 
${servicemix-version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 83,column 18] : 
${servicemix-version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 94,column 18] : 
${xbean-version} is not a valid reference.
[INFO] ********************* End of debug info from resources from generated POM ***********************
[INFO] Archetype created in dir: /Users/bsnyder/src/hello-world-smx/hello-world-se
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Mon Jan 15 13:04:08 MST 2007
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------

...

Panel

$ cd ..
$ mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-service-unit \
-DarchetypeVersion=3.1-incubating .2 \
-DgroupId=org.apache.servicemix.samples.helloworld.se \
-DartifactId=hello-world-su \ -DremoteRepositories=http://people.apache.org/repo/m2-incubating-repositoryImage Removed

This creates a directory named hello-world-su. Now edit the hello-world-su/pom.xml file to add the following dependency on the Hello World SE:

...

Code Block
$ mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-http-consumer-service-unit \
-DarchetypeVersion=3.1-incubating.2 \
-DgroupId=org.apache.servicemix.samples.helloworld.se \
-DartifactId=hello-world-http-su \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-repository

There should now be a hello-world-bc-su directory under hello-world-smx.

...

Panel

$ mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-service-assembly \
-DarchetypeVersion=3.1-incubating .2 \
-DgroupId=org.apache.servicemix.samples.helloworld.se \
-DartifactId=hello-world-sa \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-repositoryImage Removed

There should now be a hello-world-sa directory under hello-world-smx.

...

Code Block
$ cp hello-world-se/target/hello-world-se-1.0-SNAPSHOT-installer.zip $SERVICEMIX_HOME/install/
$ cp $SERVICEMIX_HOME/components/servicemix-shared-3.1-incubating.2-installer.zip $SERVICEMIX_HOME/install/
$ cp $SERVICEMIX_HOME/components/servicemix-http-3.1-incubating.2-installer.zip $SERVICEMIX_HOME/install/
$ cp hello-world-sa/target/hello-world-sa-1.0-SNAPSHOT.jar $SERVICEMIX_HOME/deploy/

...