Skip to content

Changes in 4.2.0

BJ Hargrave edited this page Feb 24, 2019 · 29 revisions

Bnd/Bndtools 4.2.0


  • Bndtools is now built to run on Eclipse Oxygen or later.
  • The Bndtools repo has been merged into the Bnd repo. So there is now a single repo and a single build which builds Bnd and Bndtools.
  • New project wizard follows any workspace settings like src folder path, etc.
  • Bndtools builder now understands the new -builderignore instruction.
  • Added BndContainerRuntimeClasspathEntryResolver to provide better runtime class path fidelity in Eclipse with Gradle builds for Bnd Workspace model builds. This change removes undesired transitive project dependencies which can cause improper shadowing during runtime (such as JUnit test execution).

Bndtools M2e

  • Settings defined in a bnd-resolver-maven-plugin execution are reflected in the editor, such as <bundles>, <scopes> and <includeDependencyManagement> (the link is defined by the first execution found listing the bndrun file in the <bndruns> configuration element. Note that any bndrun file should only be listed in one bnd-resolver-maven-plugin execution.)
  • Multiple maven-jar-plugin executions per project are supported and result in built jars from Eclipse.
  • Integrate bnd-resolver-maven-plugin configuration into Bnd OSGi Run Launch launcher so that maven projects can be launched with ease.
  • Integrate bnd-testing-maven-plugin executions into Bnd OSGi Test Launch (JUnit) launcher such that tests can be executed at the project, package, class or method level from the Eclipse workspace.


  • Changed use of reflection in many places to use MethodHandles. This should provide some performance improvements especially in macro processing.
  • Bnd CI builds now also build and test on Java 11.
  • A brand new class file object model and parser was added and class file processing was improved which should realize some performance improvements. A side effect of this is that Bnd is much more thorough at locating Class.forName references in processed byte code and can then generate Import-Package clauses for those referenced packages that Bnd 4.1 did not see. So you may see additional packages in the generated Import-Package manifest header.
  • The -pom instruction will now add -buildpath dependency information to the generated pom's <dependencies> section for each -buildpath entry that contains a resource. You can use the maven-scope attribute on a -buildpath entry to use a different scope than compile for the generated <dependency>.
  • Built-in project path properties such as project.buildpath and project.sourcepath now use File.pathSeparator to separate entries in the path. Previously : was always used as the path separator.
  • Added macro support to reference environment variables by prefixing the environment variable name with env.. For example: ${env.HOME}. This is consistent with Maven's support for accessing environment variables.
  • Connections settings file processing now supports using macro values to access system properties and environment variables.
  • The OSGiRepository repository type can now use an index.xml or index.xml.gz file inside a jar or zip file. This allows one to package an index in a jar file which can then be placed in a remote repository such as Maven Central. When the locations property refers to a jar or zip file, the index will be looked for in the root of the jar or zip file.
  • Bnd now supports use of bundle annotations which meta annotated repeated annotations.
  • DS annotation processing will now better handle when the type of a field annotated with @Reference cannot be located during processing.
  • Added support for a bnd.home.dir system property which can be used to override the default Bnd home directory of ~/.bnd.
  • Enhanced error checking when using the DS Reference annotation on fields.
  • Added special @bundlesymbolicname and @bundleversion properties which are usable in the Import-Package header. You can reference the Bundle-SymbolicName and Bundle-Version of the exporter on the class path by using the ${@bundlesymbolicname} and ${@bundleversion} values.
  • Added ${list} macro which can be used to escape semicolons in a property value so it can be used as a list in another macro.
  • Added ${replacelist} macro to better handle parsing a list containing quoted strings such that commas in a quoted string portion of a property value will not be used as a list item separator.
  • Added ${replacestring} macro which treats the argument as a string rather than a comma separated list of items.
  • Most macro implementations in Macro class were updated to share common code.
  • The new -bundleannotations instruction tells bnd which bundle classes, if any, to search for OSGi Bundle annotations. bnd will then process those annotations into manifest headers. Defaults to all (*).
  • The new -diffpackages instruction names of exported packages to baseline. (Bnd workspace only.)
  • Documented the -diffignore instruction which specifies manifest header names and resource paths to ignore during baseline comparison. (Bnd workspace only.)
  • Documented the -dependson instruction which adds dependencies from the current project to other projects, before this project is built, any project this project depends on will be built first. (Bnd workspace only.)
  • New framework to test OSGi bundles against an actual OSGi framework in standard off the shelf JUnit tests that run in any build tool. This tool, Launchpad, is highly integrated with the Bnd Workspace model. It provides a builder API to setup the framework from bndrun files or bnd bundle specs which have full access to the Workspace. Launchpad is highly optimized for JUnit testing. Launchpad adds minimal classes to the testpath of the JUnit test.
  • Snapshot bundle that captures the state of the framework when the framework is stopped. Also provides a gogo command.
  • A bnd gogo command that updates the very old command bundle from Apache Felix. Adds a lot of information and a generic output format that is easy to combine with SQL like joins and filters.
  • Added an RPC interface to the Workspace, activated when -remote-workspace=true. This is used in Launchpad.


  • A class for injection objects from some domain source via a customizable annotation: Injector.
  • Updates to Converter: better null handling for primitives, support Optional.
  • A simple Aspects class that is very useful if you need to do something before, around, or after a method call.
  • Added many functional interfaces that throw exceptions in the aQute.lib.exceptions package.

Bnd Command Line


  • Various doc updates and additions.

Bnd Maven Plugins

  • The bnd-maven-plugin will now generate more bundle headers values from pom information.
  • The bnd-export-maven-plugin, bnd-resolver-maven-plugin, and bnd-testing-maven-plugin plugins have new scopes configuration properties to allow the resolver scope to be configured.
  • The bnd-export-maven-plugin and bnd-resolver-maven-plugin plugins have new skip configuration properties to allow the plugin to be skipped for the project.
  • The bnd-export-maven-plugin, bnd-resolver-maven-plugin, and bnd-testing-maven-plugin plugins have new includeDependencyManagement configuration properties to allow the resolver to search the <dependencyManagement> for bundles (honoring the scope configuration).
  • The bnd-indexer-maven-plugin plugin has a new absolute configuration property to allow the generated index to use absolute paths for local files.
  • New bnd-run-maven-plugin for running a bndrun file from the command line.

Bnd Gradle Plugins

  • The Bnd Gradle Plugin jar, biz.aQute.bnd.gradle, has been changed to no longer include all Bnd dependencies. Its pom file now has a <dependencies> section which references any required Bnd dependencies which must be available to the build script.
  • The Bnd Gradle Plugins have been updated to support Task Configuration Avoidance when using Gradle 5.0 or later. This should provide a reduction in build time for large builds especially when only building a subset of the complete build. To take complete advantage of this, you will likely need to make modifications to your build scripts to also avoid task configuration. See how Bnd's own build scripts were updated for this.
  • A base property has been added to the Index task type. This can be used to specify a different URI base for the generated index.
  • Properties diffpackages and diffignore have been added to the Baseline task type.
  • The jar task for workspace model builds now understands the new -builderignore instruction.

Backward compatibility

  • Bndtools is now built to run on Eclipse Oxygen or later. So Bndtools 4.2 may not run on older versions of Eclipse.

Known Issues

  • None at this time.
You can’t perform that action at this time.