Bndtools

Add this URL to your Eclipse Installation to reach this solution's update site.

2018-12 (4.10)
2018-09 (4.9)
Photon (4.8)
Oxygen (4.7)
Neon (4.6)
Mars (4.5)
Luna (4.4)


Learn more...

Details Group Tabs

Details
Bndtools: the Development Environment for OSGi Bundles and Applications

What is Bndtools?

Bndtools is an Eclipse based development environment that significantly simplifies the development of OSGi Bundles and application. It provides all the features one can expect from a popular IDE. On top these formidable shoulders it adds thousands of functions to simplify the development of OSGi and help create more resilient bundles. For this, it is based on bnd, a library that is used in the majority of OSGi builds to make the bundles more robust. Since bnd is used by the OSGi Alliance to build some of the reference implementations and all test suites, it is guaranteed to support every latest OSGi feature and beyond.

Coding in Bndtools

Coding in Bndtools is highly interactive. Often you code bundles in a life environment. Any changes you make in the workspace are immediately build into bundles and then deployed to active framework that is either on your local machine or remotely. Sometimes you will forget that you have not restarted the framework for days or that you test code unnecessarily on a remote machine.

Related projects are grouped in a workspace. This simplifies the development of cohesive components by sharing information without forcing that information to become public. I.e. a workspace is a module that consists of bundles. In Bndtools you don’t write a Manifest file, you write a bnd file. This is a property file that supports all kinds of conveniences over the Manifest writing like they do in PDE. You can use wildcards when applicable and a powerful macro language makes it very easy to only define facts in one place to avoid redundant information. It is also possible to create manifest headers through annotations. For all important headers there are very useful defaults like for example the Bundle Symbolic Name (which is the project name). For most bundle projects, the actual information in the bnd file is quite small and does not change often.

The state of the art of OSGi is to use declarative services with their standardized annotations. Bndtools has wizards for DS components and reports and misuse of the annotations at the place where they happen. Since Bndtools always builds after any change, the feedback is direct.

There are several editors provided with Bndtools. The bnd editor provides completion of instructions and tooltips on headers and instructions. It is directly integrated with the error reporting. The JAR editor shows the contents of a JAR and can print an overview of the OSGi relevant details of a JAR.

Bndtools has a flexible model for Workspace templates and Project templates. Workspace templates can come from a remote repository, for example from your organization. A wizard allows a workspace template to update an existing workspace or create a new workspace. The project templates can come from repositories and use a powerful templating language (Moustache). This makes it easy to add organization specific project templates.

Versioning Bndtools

In a component system versioning is unavoidable, systems that do not version their packages will be very hard to evolve over time. Bndtools supports semantic package versions using the OSGi annotations for package versions and consumer/producer types in the package folder. By placing all the information in the package folder, close to where the changes happen, makes it easy to maintain proper versions. When the manifest is calculated by bnd all this information is taken into account, verified, and then used to generate the OSGi headers using OSGi’s definition of _semantic versioning_. With Bndtools, package versions are natural, hardly require work, and mistakes are caught before they percolate through the system. If you violate the rules of semantic versioning, for example you add a method to an interface without bumping the version, then Bndtools can tell you that you just broke backward compatibility. If you work with other people then you have to be careful when you change API! Even experienced users tend to forget in their rush to pay attention to this backward compatibility. Fortunately, Bndtools can continuously check your new bundle against the previously released version. If bnd detects any incompatible changes (without the appropriate version change) then it will balk and point out where to fix it: either the version or the line that caused the incompatibility. This alone could be a reason to switch to Bndtools.

Build Support in Bndtools

Bndtools is the user interface on top of bnd, where bnd is the headless build library that provides a build model. This library is used in Gradle, Maven, Ant, SBT, and other build tools. Over time it has been expanded with lots of functions to make builds easier.

First, bnd is a pull model. Instead of taking the contents of a project bnd makes you define what packages are part of the bundle. These packages can come from your project but also from other projects or other JARs. This provides a lot of leeway in designing the packaging of a bundle. You can also specify what resources should be included and at what path. Overall the bnd file has much more flexibility than most other build environments to package a bundle.

The bnd files can use a very powerful macro language. The macros can be used to define facts in one place and use it in different places. However, built in macros provide access to the current operation like the actual exported packages, the imports, the time. You can also access the file system or OS commands. For example, the macros can be used to add a number of JAR files in a local directory to the Bundle-ClassPath.

Dependencies in bnd come from repositories. In Bndtools the repositories can be viewed and edited. Currently, bnd supports repositories for OSGi XML files with Capabilities & Requirements, Maven, simple file repositories, and others. It is quite easy to add additional repositories to bnd.

Bndtools provides extensive support to collaborate with maven projects. Bundles can be created with a POM file inside in the same way Maven does. The contents of this POM is derived from the manifest headers. With the Maven Bnd Repository that is included there is full maven repository support. It integrates with Nexus, Artifactory, and the local machine based repository. It supports snapshots and releases. Bndtools dependencies can come from Maven repositories and can be released to them as well. Try it out, in contrast to m2e Bndtools is much more interactive.

Assembly with Bndtools

OSGi is a reusable component system. One stage in the development of an application is therefore to assemble a set of components and configure them. Bndtools supports assembly with a resolver that can create the list of bundles needed to satisfy a set of initial requirements. Instead of discovering more and more dependencies by dragging in a new dependency, in Bndtools you can just drag the XRay bundle to the initial requirements list and then the resolver will include Web Console, an Http Server, DS, and all other required bundles. This tool can be an enormous time saver because it can be really hard to create a consistent set of bundles that actually works when deployed.

Debugging in Bndtools

In Bndtools when you debug or launch an application your code sees an environment that is identical to the runtime of the application when it runs standalone, unlike PDE. This avoids the Heisenbugs that only occur in runtime. It also has the effect that your code becomes much more robust because any errors in handling the OSGi dynamics will be found quickly because you can develop so interactively. Bndtools uses the hot deployment mechanisms of OSGi to deploy updated bundles from the workspace in the framework seamlessly. Bndtools has almost the feeling of a dynamic language with REPL (Read, Eval, Print, Loop). For people used to PDE or even normal Java development this is jaw-dropping. Try it, developing bundles is fun with Bndtools. Debugging applications can happen locally on your machine but it can also happen on a remote, potentially much smaller like a Raspberry Pi, machine. Both local and remote are completely interactive.

Verification in Bndtools

Every Bundle made with bnd is verified as much as possible. Many errors are directly reported in the source code at the proper place. The bnd library is continuously expanded to diagnose problems and warn about them.

Testing with Bndtools

Bndtools supports proper JUnit testing with the standard Eclipse GUI. However, bnd also supports testing in a life OSGi framework. This bnd test framework is fully integrated with the Eclipse JUnit GUI; it is hard to see the difference.

Continuous Integration with Bndtools

Any Bndtools workspace can also be built with Gradle because bnd also provides an excellent Gradle plugin that guarantees the same output that Eclipse generates from the same bnd files. This Gradle plugin can also be used standalone for classic Gradle projects.

Getting started with Bndtools via OSGi enRoute

The OSGi Alliance has invested in making it easier to get started with OSGi. Work done in extending Bndtools/bnd is one part of this effort. You can find documentation, tutorials, examples, application notes and a forum on the OSGi enRoute site.

Contributing to Bndtools

Bndtools and bnd are fully build with Bndtools. You can find the Git repositories on Github. Any feedback can be reported there and we welcome PRs.

What is new in Bndtools 3.3.0?
  • Task Progress / Non-blocking UI
  • Bnd Workspace Improvements
  • Standalone support — for launching OSGi apps without a bnd workspace
  • Improved integration with Eclipse debugger
  • Repositories View Improvements
  • Lots of smaller improvements
Additional Details
Eclipse Versions: 
2018-12 (4.10), 2018-09 (4.9), Photon (4.8), Oxygen (4.7), Neon (4.6), Mars (4.5), Luna (4.4)
Platform Support: 
Windows, Mac, Linux/GTK
Organization Name: 
Date Created: 
Tue, 2010-05-18 23:11
Development Status: 
Production/Stable
License: 
EPL
Date Updated: 
Fri, 2018-10-19 02:52
Metrics
DateRankingInstallsClickthroughs
December 2018186/902212 (0.07%)9
November 2018175/939505 (0.08%)17
October 2018160/943597 (0.09%)18
September 2018144/941571 (0.11%)14
August 2018153/939522 (0.1%)6
July 2018143/940627 (0.12%)17
June 2018147/947521 (0.11%)20
May 2018156/954566 (0.1%)13
April 2018146/946600 (0.11%)5
March 2018145/961616 (0.11%)11
February 2018137/940593 (0.13%)7
January 2018142/945594 (0.12%)11
View Data for all Listings
Errors
External Install Button

Marketplace Drag to Install button

By adding the following code below to your website you will be able to add an install button for Bndtools.

HTML Code:


Markdown Syntax:



Output: Drag to your running Eclipse* workspace. *Requires Eclipse Marketplace Client
Sunday, December 16, 2018 - 10:21
amisingname5ke's picture

Here's a thing.

On Linux (with an Ubuntu base) ... In order to get updates & installs one need to '_sudo_' Eclipse. At least that is the most feasible explanation. Works for Windows and Mac.

At that point things seem to fall in a mess; the drag-n-drop jumps to some generic Marketplace page. I imagine, the basic issue lies around switching from "user" to "sudo" (root) via the drag.

That makes sense; why WOULD I like to allow an un-secure user login drop things on a 'trusted' app?!! Right decision.

Not sure how we deal with this -- One idea is to prompt; the way the shell (e.g. bash does). I think that's an Ubuntu / desktop issue but the underlying bits -- Like applications that update themselves; these elements need to "push" fixes to the community!

There is a rider. NOPE; I (personally) do not want powerful developer tools like Eclipse to have "super-user"-level privileges without authentication/authorisation. Should I ever develop a psychotic disorder like that, I can just re-install Windows!

twindham2jo's picture

I tried to install BND Tools today, and the update site at http: // bndtools-updates.s3.amazonws.com/ is reported as unavailable. Is there any new news about the status on this site?

kwulf2ep's picture

As you can see in the Errors tab, it has been reported several times in the past 7 days, that the download from the update site is not working. Same with me, I cannot download the bndtools plugin using Eclipse 4.3.1 (Kepler SP1). There is a Bndtools dependency missing. Please fix it or provide another update site, Thanks!

cmisingname0wt's picture

Best support für MANIFEST generation in Eclipse by BND.
If you like to have a lightweight OSGi development tooling Bndtools is at the moment the best choose.