Thursday, September 13, 2012

ServiceMix: Autodeployment of the bundle snapshots

You can tell Karaf to scan your local Maven repositories for the latest version of the given bundle.
smx@root> osgi:install mvn:com.example/my-bundle/0.1.0-SNAPSHOT
Bundle ID: 227
smx@root> dev:watch 227
Watched URLs/IDs: 
Now whenever you install new version of the bundle to your local snapshot repository, Karaf will fetch the proper jar and deploy it to the ServiceMix.
smx@root> [Watch] Updating watched bundle: my-bundle (0.1.0-SNAPSHOT)
Good thing for fast system tests in the development environment.

PS Thanks to Łukasz Dywicki (aka Karaf-PMC-master) for a good comment.


  1. It works well but only with local repositories. So it scans your .m2/repository or any other location which is configured in org.ops4j.pax.url.mvn. However it does not support remote repositories - if you will deploy snapshot on Nexus do not expect that Karaf will catch this event..

    You can also use url like 'mvn:com.example/my-bundle', Karaf (Pax-Url Mvn) will find most recent version and install it.

  2. Thanks for good comment Łukasz. I've edited the post to make clear that only local repos are scanned.

    PS Congrats for the Karaf PMC :) .