LibraryLink ToToggle FramesPrintFeedback

Stage 3: Build and Run the Sample Project

In this stage, you use Maven to build and run the sample project.

To build and run the sample project do the following:

  1. In a command window, change to the ProjectRoot/simple-router directory.

  2. Enter the following command to build the project:

    mvn install

    Maven builds the project and creates a target directory for the build artifacts:

    ProjectRoot/simple-router/target
    ProjectRoot/simple-router/target/simple-router-1.0-SNAPSHOT.jar 1
    ProjectRoot/simple-router/target/classes
    ProjectRoot/simple-router/target/classes/log4j.properties  2
    ProjectRoot/simple-router/target/classes/META-INF
    ProjectRoot/simple-router/target/classes/META-INF/spring
    ProjectRoot/simple-router/target/classes/META-INF/spring/camel-context.xml
    ProjectRoot/simple-router/target/classes/tutorial
    ProjectRoot/simple-router/target/classes/tutorial/MyRouteBuilder.class  3 
    ProjectRoot/simple-router/target/maven-archiver
    ProjectRoot/simple-router/target/maven-archiver/pom.properties

    Some of the project artifacts are described below:

    1

    simple-router-1.0-SNAPSHOT.jar is the deployment JAR.

    2

    log4j.properties is a properties file used to control logging levels.

    3

    MyRouteBuilder.class is the class file compiled from MyRouteBuilder.java.

  3. Enter the following command to run the project:

    mvn camel:run

    When Apache Camel starts, it prints lines like the following to the console:

    23-Feb-2009 16:51:04 org.apache.camel.spring.Main doStart
    INFO: Apache Camel 2.4.0-fuse-00-00-fuse starting
    23-Feb-2009 16:51:04 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    ...

    The sample application runs until you stop it. It routes messages from ProjectRoot/simple-router/src/data to either ProjectRoot/simple-router/target/messages/uk or ProjectRoot/simple-router/target/messages/others.

    You can stop the application by pressing Ctrl+C.