devoured elysium
devoured elysium

Reputation: 105067

Installing a couple of bundles automatically with OSGi

I'm looking for a way to automatically install a couple of bundles into an OSGi application, ideally by some kind of batch file / console script so as to allow us to embed it into our build process.

The ideal situation would allow me to just pass the update site URLs to the console and have it download and install them as that would spare from having to install the jars one by one.

Is this possible? Beware that the application I'm talking about is not Eclipse although it contains a couple of Eclipse plugin jars in its bundles directory. I reckon this fact may well imply a slightly different approach to the situation, although I'm not totally sure.

At the moment I'm in control of the application's OSGi console (p2), so I guess that would be the right tool to use, from what I've read.

Thanks

Upvotes: 2

Views: 774

Answers (1)

Marcel Offermans
Marcel Offermans

Reputation: 3323

There are several ways to go about this (apart from using p2 which you already mention):

  1. Use the Apache Felix Gogo shell, which has commands to install bundles from a URL, and create a script for that that is executed at startup.
  2. Use the Apache Felix File Install bundle, which allows you to put all bundles in a "hot deploy" folder and automatically installs them.
  3. Use Apache ACE, which is a full blown provisioning solution that allows you to map artifacts to target systems.
  4. Use a Bnd feature to create an executable jar that embeds both the OSGi framework and all bundles and launches them when you start the jar.
  5. Use Apache Karaf features, which allow you to define a list of URLs as a feature and install that feature (using a shell similarly to #1).

There's a lot more to say about each of them, but these are the most-used options I'm aware of.

Upvotes: 4

Related Questions