You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by James Strachan <ja...@gmail.com> on 2009/05/21 18:15:41 UTC

making a self contained executable jar for the examples

You might make a little Camel sample and want to send it to a
colleague so they can play with it. Using Camel-Web could well be the
easiest option, as they can then drop the WAR into a Tomcat/Jetty. Or
you can use camel-web-standalone as an example pom.xml to then make an
executable jar from the WAR (its a shame thats not a maven plugin, so
any WAR project could also generate an executable jar of itself!).

Another option is to not use a web app at all and just have a command
line executable. As an experiment I hacked the camel-example-spring to
do this. It generates a jar you can start from the command line.

e.g.

  cd examples/camel-example-spring
  maven install
  java -jar target/camel-example-spring-2.0-SNAPSHOT.one-jar.jar -ac
META-INF/spring/camel-context.xml

The command line arguments should not be required; but for some reason
the onejar plugin sets the classloader up so that Spring can't use
META-INF/spring/*.xml to find the XML files. I wonder if we can either
fix it, or use a default named camel XML file? Maybe
META-INF/spring/applicationContext.xml is a better default?

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/