29.11.11

InfoQ: BndTools provides OSGi Development in Eclipse

InfoQ: BndTools provides OSGi Development in Eclipse
http://bndtools.org/doc/tutorials/

BND 

Bnd is an extremely powerful but low-level tool for building and analysing OSGi bundles. It was developed by Peter Kriens (the OSGi Alliance's Technical Director) and is used by the OSGi Alliance to build their own suite of API, compatibility test and reference implementation bundles. As a low-level tool it is easily embeddable and can be called directly from the command line, used an ANT task, or embedded in Maven and IDEs.

Bndtools

Bndtools uses bnd as its "engine". All of the smarts are in bnd essentially, and Bndtools just figures out when it should call bnd and presents the results nicely. Because many other tools embed bnd, the descriptor files used by bnd have almost become a de-facto standard, meaning that it is easy for a Bndtools developer to collaborate with developers using other tools, or to migrate permanently to another tool if they choose.

Eclipse PDE

Eclipse PDE is another OSGi development environment based on Eclipse.

PDE follows a different philosophy to bnd and Bndtools, called "manifest first". In PDE you directly edit the MANIFEST.MF file that goes straight into the bundle without any post-processing. Our philosophy is that the MANIFEST.MF should be treated almost like a compiler output: i.e., it should be generated from a simpler source artefact. This is important because a full MANIFEST.MF contains quite a lot of duplicate information or information that should be derived directly from the Java code, for example the list of packages-level dependencies. Manually editing such information is laborious and error-prone.

JRebel

  • JRebel is a powerful tool for speeding up redeployment of code during development, but it does not provide any kind of module system, either at runtime or at build time. 
  • JRebel is about getting your code out of the IDE and into the Java EE application server as quickly as possible.
  • JRebel is not particularly useful when developing for OSGi.

maven

For Maven users the most popular approach to OSGi development is to use the Maven Bundle Plugin, which is another tool that embeds bnd. Bndtools integrates with Maven via this plugin and via M2Eclipse. In this scenario, M2Eclipse subsumes responsibility for managing the build depdendencies (in the POM, obviously) and for actually building bundles, but Bndtools continues to add value by providing a way to edit and analyse bundle descriptors and dependencies, and a way to setup and execute run configurations.

No comments: