Versions Compared

Key

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

...

Let's try to build the jar. Remove the test classes and sample classes if you used the artifact, then from the command line, run:

Code Block
mvn install

The end of the maven output should look like:

Code Block

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
Tip
titleUsing Java 5

If you see something like that:

Code Block

[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
/Users/gnodet/work/servicemix/smx4/tmp/org.apache.servicemix.kernel.gshell.config/
xxx/src/main/java/org/apache/servicemix/kernel/gshell/config/ListCommand.java:[6,1] annotations are not supported in -source 1.3
(try -source 1.5 to enable annotations)
@CommandComponent(id="config:list", description="List the available configurations")

that's because we forgot to enable Java 5. So let's add that to the pom:

Code Block
langxml

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>1.5</source>
            <target>1.5</target>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

Let's try again, and we should now have:

Code Block
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------

Turning the jar into an OSGi bundle

...