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.0 1 or higher
  • A broadband internet connection (so Maven can automatically download dependencies)

...

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-SNAPSHOT) identify which Maven archetype to use for the archetype:create goal, while the last two parameters (-DgroupId=org.apache.servicemix.samples.helloworld -DartifactId=hello-world-se) uniquely identify the Maven project that is being generated. The groupId (printed in pink) 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.

...

Panel

Wiki Markup
\[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\] <span style="color: #ff00ff">Defaulting package to group ID: org.apache.servicemix.samples.helloWorldSE</span>
...
\[INFO\] **\**\**\**\**\**\**\**\**\**\* End of debug info from resources from generated POM **\**\******************\*
\[INFO\] <span style="color: #009900">Archetype created in dir: /Users/bsnyder/src/hello-world-se/hello-world-se</span>
\[INFO\] \-----------------------------------------------------------------------\-
\[INFO\] BUILD SUCCESSFUL
\[INFO\] \-----------------------------------------------------------------------\-

Again, Maven creates a directory using the artifactId provided (printed in green in the command and output). Inside this directory resides the pom.xml and the src directory.

Note
titleIn case of a BUILD ERROR: Maven plugin version requirement

The maven-archetype-plugin 1.0-alpha4 or above is required for this tutorial. When an older version is installed, a build error will occur. The version of this plugin can be checked by verifying the name of the following directories:

Code Block
titleUnix
\~/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin 
Code Block
titleWindows
C:\Documents and Settings\<USERNAME_><USERNAME>

In case the only version available of the maven-archetype-plugin is an older one, a minimal pom.xml file will need to be created manually in the hello-world-se directory. Below is a simple POM to use for this purpose:

Code Block
titleMinimal pom.xml
<?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.samples</groupId>
  <artifactId>hello-world-se</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-archetype-plugin</artifactId>
          <version>1.0-alpha-4</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

Creating the JBI Service Engine

1) Change the package name from org.apache.servicemix.samples.helloworld to org.apache.servicemix.samples.helloworld.se

Creating the Maven Subprojects For the Service Unit and Service Assembly

...