Skip to content
BJ Hargrave edited this page Dec 18, 2019 · 30 revisions

Bnd/Bndtools 4.3.0

  • All projects are now dual licensed under Apache-2.0 OR EPL-2.0.

Bndtools

  • Updated support for ordering the runbundles, see startlevels

Bndtools M2e

  • Now avoids doing a full maven build when only the indexes need to be updated.

Bnd

  • HttpClient has been significantly updated to support retrying failed connections including connection timeouts, read timeouts, hung connections, 5xx response codes, read-into-cache failures, and other exceptions in establishing the connection. The default retry count is 3; the retry count can be set via the retries method on HttpRequest. HttpClient will delay between retry attempts. The default delay for the first retry is 1 second with the delay doubling for each subsequent retry up to a maximum of 10 minutes; the retry delay, in seconds, can be set via the retryDelay method on HttpRequest.
  • The MavenBndRepository got a bit of an overhaul:
    • The index file can now use Workspace macros and properties. This allows values set in the workspace to be used in the index files and evaluated before processing by MavenBndRepository. Macros are applied per line so they only work for one GAV, you cannot specify a list of GAVs in a macro.
    • A new configuration property source can contain space/newline separated GAVs that are always added to the set. This allows you to specify the GAVs in the bnd file, reducing clutter and allowing the use of list macros
    • When used in Bndtools, bnd will now automatically try to attach the source of an OSGi bundle.
    • Adding and removing of bundles via the menu or drag and drop will now not destroy the format of the maven file. It will try to keep the file in the same format including comments. The features have been documented.
  • Launchpad is a new comprehensive testing framework integrated with the Workspace model of Bndtools. It has been documented.
  • P2Repository has been updated to support checking MD5 checksum on downloads and retrying if the MD5 does not match. Two retries will be made for failed MD5 checksums.
  • OSGiRepository has been updated to support checking SHA256 checksum on downloads and retrying if the SHA256 does not match. Two retries will be made for failed SHA256 checksums.
  • CDI Annotation processing can detect the appropriate discovery mode from a beans.xml file in the bundle when the discovery mode is not already selected in the -cdiannotations instruction. This helps existing projects having a beans.xml from having to duplicate the mode of choice.
  • NEW Java SPI Annotations @ServiceProvider and @ServiceConsumer to help developers to generate requirements and capabilities for the Service Loader Mediator Specification.
    • The @ServiceProvider annotation also results in generation of service descriptor files (a.k.a. META-INF/services).
  • Maven Version support has been improved to offer better fidelity to the latest maven version "rules". Any code using Bnd's MavenVersion.parseString(String) method should change to use the MavenVersion.parseMavenString(String) method or new MavenVersion(String) instead. The parseString method is probably not what you want since it parses OSGi version strings into a MavenVersion object. The Bnd code base has been corrected to avoid the parseString method.
  • NEW Bnd can produce JPMS libraries driven by Bundle Annotations using the -jpms-module-info instruction.
  • OSGiRepository no longer deletes the cache at start up.
  • Launcher is moved to require OSGi Release 6.
  • Launchpad got a JUnit Runner mode.
  • Start levels added to -runbundles.
  • Resolver can calculate startlevels based on dependencies.
  • Decoration facility to add attributes to path instructions: -runpath, -runbundles, etc. Create a header that ends with + and the same name. This is interpreted as a selector, any matching keys will get any of the attributes on the selector. Using the ! will remove the entry.
  • Baselining has been updated to support the BaselineIgnore annotation. When an element (type or member) is annotated with the BaselineIgnore annotation and is baselined against a package whose version is less then the version specified in the BaselineIgnore annotation, the element is ignored for baselining mismatch purposes and will not result in a baselining failure.
  • A number of performance enhancements were added which enables Bnd to parse manifest and bnd file information much more quickly. This is especially noticeable on large items such as distros with many bundles.
  • Bnd now tries to execute java commands from the JAVA_HOME environment variable or java.home system property rather than the path of the shell. This means Bnd will generally use the same java installation used to run Bnd to locate and execute java commands.
  • Bnd will generate uses directives on osgi.service capabilities generated for DS components.
  • Added -noclassforname instruction which can be used to tell Bnd not to look for Class.forName("some.Class") instruction sequences in method bodies.

Bnd Command Line

  • Updated resolve command to have a few more options
  • Added a bnd resolve dot command to output a graphviz dot file.
  • The run command will now actively react to changes on the bndrun file as well as runbundles and update the running instance. This enables the live coding model.
  • NEW Bnd can generate README files with the new exportreport readme subcommand.

Documentation

  • Updated documentation for Launchpad, Launcher, and startlevels
  • Added a page about resolving
  • Added a page about generating documentation

Bnd Maven Plugins

  • bnd-run-maven-plugin will now actively react to changes on the bndrun file as well as runbundles and update the running instance. This enables the live coding model.
  • NEW Bnd maven plugins operating with bndrun files can infer -runee and -runrequires from the maven project.
    • -runee, if omitted, will be inferred from the target configuration of maven-compiler-plugin
    • -runrequires, if omitted, will be inferred from the project's artifactId (as osgi.identity;filter:='(osgi.identity=<artifactId>)' if a) the project packaging is jar or war and b) the project has the bnd-maven-plugin
  • The Bnd Maven plugins are now marked thread safe and can be used with -T.
  • NEW bnd-reporter-maven-plugin is a new bnd based maven plugin that generates and exports reports of projects.

Bnd Gradle Plugins

  • The Bnd Gradle plugins now sets the time of the bundle jars to the current time when the jars are written out. See https://github.com/bndtools/bnd/issues/3118.
  • The Bnd Gradle plugins now support --parallel operation in Gradle.
  • The Export and Resolve task types now extend the Bndrun task type and thus inherit new properties: ignoreFailures and workingDir.
  • The Bndrun task type will now actively react to changes on the bndrun file as well as runbundles and update the running instance. This enables the live coding model.

Backward compatibility

  • Bndtools is built to run on Eclipse Oxygen or later. So Bndtools 4.3 may not run on older versions of Eclipse.
  • Launchpad, which previewed in Bnd 4.2, has had API changes which may not be backwards compatible.
  • When processing annotation types annotated with ObjectClassDefinition, for elements of type char or char[] having a default value, Bnd 4.3 will emit the default value in the generated metatype XML resource as a single character string. Previously, the default value was emitted as a string of the unicode value of the character. This updated behavior brings Bnd inline with the expectations of the OSGi Metatype Specification reference implementation.
  • The Bnd Maven and Gradle plugins no longer include a copy of the embedded-repo.jar resource and instead now have a dependency on the new biz.aQute.bnd.embedded-repo artifact which contains the embedded-repo.jar resource. See https://github.com/bndtools/bnd/commit/18411917632f96c5b9aadc5229be09b965762c3c. For most users of the Bnd Maven and Gradle plugins, Maven and Gradle will properly handle this new dependency and this will work correctly. But if you are directly managing the dependencies, then you will need to include the new biz.aQute.bnd.embedded-repo artifact.

Known Issues

  • Embedded-Activator support in the Launcher is broken. See https://github.com/bndtools/bnd/issues/3481. This means biz.aQute.junit cannot be used as the -tester value for OSGi JUnit test since biz.aQute.junit relies on the Launcher to invoke biz.aQute.junit's Embedded-Activator to start executing the tests.
  • While using the bnd-resolver-maven-plugin to resolve more than one bndrun file the resolution may fail. See https://github.com/bndtools/bnd/issues/3465. The workaround is to separate resolution of individual bndrun files into distinct executions of the bnd-resolver-maven-plugin.
  • -runframework: none support in the Launcher is broken. See https://github.com/bndtools/bnd/issues/3489. This support is not commonly used. It was added to support certain OSGi compliance test cases where the test case would be launching OSGi frameworks. There is no workaround.
  • #3647: When using BundleTaskCovention with the Bnd Gradle plugin for non-Bnd workspace builds, either project.version must be set or the archiveVersion properties of the JarTask must be set.
Clone this wiki locally