Versions Compared

Key

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

camel:run

The camel:run goal of the Camel Maven Plugin is used to run your Camel Spring configurations in a forked JVM from Maven. A good example application to get you started is the Spring Example.

Code Block

cd examples/camel-example-spring
mvn camel:run

This makes it very easy to spin up and test your routing rules without having to write a main(String[]) method; it also lets you create multiple jars to host different sets of routing rules and easily test them independently.

How this works is that the plugin will compile the source code in the maven project, then boot up a Spring ApplicationContext using the XML confiuration files on the classpath at

Code Block

META-INF/spring/*.xml

This allows you to boot up any Spring services you wish; whether they are Camel related or any other Spring POJOs.

If you want to boot up your Camel routes a little faster, you could try the camel:embedded instead.Created by James Strachan
On Fri Aug 17 08:57:19 BST 2007
Using TimTam