The Eclipse Bundle Recipes project (EBR) was created with the intention to develop and host a technology and recipes for creating OSGi bundles out of regular non-OSGi Java libraries. Unfortunately, not a lot has happened after it’s creation. Frankly, as the Git repository and the history unveils, it has been just a code drop of the SpringSource Enterprise Bundle Repository recipes. I’m here to change that!
As an Orbit committer, it’s has been my pleasure to convert Java libraries to OSGi for quite some time now. If you know how Orbit bundles are created, you know it’s an exercise. Thus, I also have a high motivation for the Eclipse EBR project to be successful. Last week was one of those where I looked at upgrading a few of the Orbit bundles I’m maintaining. Turns out, the libraries are actually quite active and – as every good OS project does these days – they also release very frequently. That’s really turning into a boring exercise. Thus, I decided to craft together a process that would simplify things for me.
The result is very promising. With just one nice little Maven plug-in I created, a small Maven POM and an OSGi BND descriptor file I’m now able to consume the libraries directly from Maven central (or whatever Maven repo they come from), push them through a filtering step which may remove or add files, generate the OSGi manifest headers, add p2 metadata information and deploy them back into a Maven repository (eg. a local one). Then, in a second step, I’ll let Tycho run and it creates a p2 repository where the bundles are published together with a source bundle containing the library source code. Done.
Over the next few days I’m hoping to make that available in the EBR Git repository.
For the time being I pushed it to Github*. I first need to review the dependencies and push them through the Eclipse.org IP process. Once that is done, we should have a pretty neat solution for EBR. However, remember that EBR will only host and distribute the recipes, not the actual libraries. You have to generate them yourself.
For Eclipse projects, this is where Orbit comes back into the game. Orbit can take and run the recipes of all IP approved libraries from EBR (or create its own) and publish the bundles as today in p2 repositories.
: Update, Feb. 28
I pushed the Maven plug-in as well as the first recipes to the Eclipse Git repository. You can browse them at git.eclipse.org.