Q: How can I use @ProviderCapability and @RequireCapability Annotations?

A: Add the bundle biz.aQute.bnd.annotation to your bnd.bnd. It can be found in the latest release version in maven central. Note: These Annotations will move with R7 directly in the osgi spec and bundles and will be supported directly by bnd.

Advertisements

Using P2 Repositories with Bndtools

Bndtools support multiple types of repositories to grep artifacts from. For a while now P2 Repositories are supported as well, but information on how to add them are sparse and it is not obvious if you are new to bnd.

What to do:

Open the build.bnd in the cnf Project and switch to the source view. To add a repository add an entry like this:

-plugin.3.mars: \
 aQute.bnd.repository.p2.provider.P2Repository; \
 url = http://download.eclipse.org/releases/mars; \
 name = mars

My colleague urged me to give the following WARNING after he tried it himself: This example will cause bndtools do download the whole repository with all the content. Thus this may take a while!

We hope this might be helpful to you as well.