Java Reference
In-Depth Information
appendix A:
Building bundles
Throughout this topic, you've been building OSG i 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 OSG i-specific build system. On the other hand, the more a build system under-
stands about what it's building, the more it can assist you—so which build systems
work particularly well with OSG i?
We start by revisiting bnd and Ant, but this time explaining the various bnd
instructions used in the topic 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 OSG i-specific build systems, includ-
ing 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
Apache Ant ( http://ant.apache.org ) is a build system for Java that uses XML to
describe a tree of targets, where each target describes a sequence of tasks. Ant is
extended by writing new tasks in Java, such as the bnd tool's bnd task that can gen-
erate one or more bundles from a given class path. But what exactly is bnd?
A.1.1
Introducing the bnd tool
The bnd tool ( www.aqute.biz/Code/Bnd ) was written by Peter Kriens to take the
pain out of developing bundles. Usually, when you create a JAR , you take a direc-
tory and archive its contents. This is fine for plain JAR s, but it isn't always ideal for
OSG i bundles—there's no easy way to tell if the OSG i manifest matches the contents
or to quickly slice a large project class path into a consistent set of bundles.
513
Search WWH ::




Custom Search