Appendix A. Building bundles

 

Throughout this book, you’ve been building OSGi bundles with the bnd tool, using Ant to manage the builds. If you’re a fan of Maven, you may be feeling a bit left out at this point, but don’t worry. You can build bundles with Maven using the same bnd instructions, thanks to the maven-bundle-plugin. To build a bundle, all you really need is the ability to customize the JAR manifest; you don’t need to change to an OSGi-specific build system. On the other hand, the more a build system understands about what it’s building, the more it can assist you—so which build systems work particularly well with OSGi?

We start by revisiting bnd and Ant, but this time explaining the various bnd instructions used in the book along with some advanced ones with which you may not be familiar. After that, we’ll show you how to migrate a Maven project to use bnd and introduce some features specific to the maven-bundle-plugin. Finally, we’ll round things off with a brief overview of more OSGi-specific build systems, including Eclipse Plug-in Development Environment (PDE) and Maven Tycho. But first, let’s return to where we left off: building bundles with Ant.

A.1. Building with Ant

A.2. Building with Maven

A.3. For your consideration