camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <>
Subject making a self contained executable jar for the examples
Date Thu, 21 May 2009 16:15:41 GMT
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.


  cd examples/camel-example-spring
  maven install
  java -jar target/ -ac

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?


Open Source Integration

View raw message