Skip to content
BJ Hargrave edited this page Sep 20, 2021 · 37 revisions

Bnd/Bndtools 6.0.0

Bndtools

  • Bndtools is built to run on Eclipse 2020-06 (4.16) or later. This was changed from Eclipse 2018-12 (4.10) in the last release. So Bndtools 6.0 may not run on older versions of Eclipse.
  • Bndtools OSGi JUnit launches running in continuous mode will now relaunch indefinitely. In earlier versions, there was a bug where the test process' console would be closed after MAX_TEST_RUNS (a user-configurable JUnit GUI option that defaults to 10), even though the process continued to run and could not be shut down.
  • More Quick Fix suggestions:
    • Unknown cast expression if the mismatch is caused by a missing supertype (eg, C extends B extends A, compiler can't verify a downcast from A to C if B is not on the classpath).
    • Unknown throwable classes caused by a missing supertype (eg, if C extends B extends Throwable, the compiler can't verify a catch (C) clause if B is not on the classpath).
    • Unhandled exception errors caused by a missing supertype (eg, if C extends B extends RuntimeException and B is not on the path, then the compiler will treat methods that declare throws C to be surrounded with a try/catch).
    • "Discouraged access" warnings when the classes might be exported by another bundle.

Bndtools m2e

  • Bndtools m2e is built to run on Eclipse m2e 1.16.0 or later. This was changed from Eclipse m2e 1.10.0 in the last release. So Bndtools m2e 6.0 may not run on older versions of Eclipse m2e.
  • A build loop was fixed where Bndtools m2e could loop rebuilding the jar.

Bnd

  • Property naming prefix in cnf/ext/*.bnd changes - If an property name is already declared elsewhere, the file name will now be used as a namespace. In previous versions it has been used as a prefix. Before -plugin in cnf/ext/test.bnd became test.-plugin, now it will be -plugin.test.
  • A number of previously deprecated types and members have been removed. So code using these will need updates.
  • Selectors in instructions now support the o optional flag. If the selector ends with :o, then the selector is marked optional. This means that when Bnd might warn about unused selectors, it will not warn that an optional selector is unused.
  • The -runjdb instruction is updated to support a host:port value for the -agentlib:jdwp=transport=dt_socket address option.
  • The githead macro has been updated to understand git worktrees.
  • Added support for the new features in the forthcoming OSGi Declarative Services 1.5 specification from the OSGi Working Group at Eclipse.
  • Baselining fixes were added so that CLASS retention annotation changes are MICRO bumps, inserted super classes and super interfaces are now properly handled, and BaselineIgnore is now supported on package-info.
  • BndPomRepository - By setting dependencyManagement=true, the repository now considers the dependencyManagement of a pom as well.
  • Support for 'libraries' were added with the -library instruction. Libraries are bundles that can carry a workspace, project, or bndrun file plus any additional (binary) resources like for example a repository content. If a library is selected, it is expanded in the bundle cache and the appropriate bnd is included. Library bundles are stored in repositories or on the file system. See -library
  • Internally the bnd Workspace, Projects, and repositories now have a centralized event model that will make it easier to use bnd in different IDEs.
  • Changed Start Level RuntimeHandler to use a Synchronous Bundle Listener due to a race condition.
  • Updated generate.
    • Multiple clauses using the same output conflicted. Changed to prepare the steps so directory clean happens before all steps.
    • Using plain maven JARs had a cast problem with versions. Now supports bnd.info namespace for versions and properly coerces the version to a bnd version.
    • A JAR without a main class in the manifest can now be used. If the JAR had no Main-Class, an error was reported. Now the classpath option is first passed. If there is no Main-Class in the manifest but the classpath is set then we try the command anyway.
  • Many deadlocks with project building resolved
  • OBR Exporter of bndrun files to Repository XML, read more
  • AspectJ plugin
  • The JUnit Platform tester bundle will now only output status about skipped/aborted tests if the tester.trace property is set.

Bnd Command Line

  • TBD

Documentation

  • TBD

Bnd Maven Plugins

  • The Bnd Maven plugins now require a minimum of Maven 3.3.9. This was changed from Maven 3.1.1 in the last release.
  • The Bnd Maven plugin can be configured to skip the processing of missing or empty output directories. Use the configuration properties skipIfEmpty to enable this mode. This helps configure the bnd-maven-plugin in a parent pom without requiring all projects to emit bundles and works in conjunction with the maven-jar-plugin's property of the same name (skipIfEmpty). It also enables projects to produce test artifacts without requiring a main sources or artifact.

Bnd Gradle Plugins

  • The Bnd Gradle plugins and tasks now support Gradle 7.
  • The Bnd Gradle plugins and tasks underwent a large update to modernize their implementations and prepare for Gradle 7 and newer Gradle idioms. The implementation classes have all been rewritten in Java. All Bnd Gradle task properties are now Gradle Properties and should generally be set using an assignment in your build script. This also means the Gradle Properties are typed and expect the correct value when being set. So, using the Export task as an example, set the bndrun property with bndrun = file('mybndrun.bndrun') rather than bndrun 'mybndrun.bndrun'. With the change to use Gradle Properties, the latter example is no longer possible as Gradle expects the bndrun(String) method which does not exist. So you may need to update your build scripts to use assignment of the proper argument type for setting task properties.
  • Added outputBndrun property to the Resolve task type. This allows the resolve operation to write the resolution to an output bndrun file which can then be used as input to another task such as a TestOSGi task. Because the Bnd Gradle tasks use Gradle Properties, the connection of the outputBndrun output property of a Resolve task to the bndrun input property of a TestOSGi task, for example bndrun = resolveTask.flatMap { it.outputBndrun }, enables Gradle to know that the Resolve task must be executed before the TestOSGi task.
  • A number of previously deprecated task properties and task property setters/getters have been removed.
    • Baseline.destination is replaced by Baseline.reportFile.
    • Bndrun.workingDir is replaced by Bndrun.workingDirectory.
    • Export.destinationDir is replaced by Export.destinationDirectory.
    • Index.destinationDir is replaced by Index.destinationDirectory.
    • TestOSGi.resultsDir is replaced by TestOSGi.resultsDirectory.
  • Gradle is deprecating the convention concept and build scripts need to move to use the replacement extensions before Gradle 8.
    • BndPluginExtension replaces the now deprecated BndPluginConvention.
      • The bnd(), bndis(), bndMerge(), bndProcess(), and bndUnprocessed() methods in BndPluginConvention should no longer be used and build scripts should be updated to use the equivalent methods, get(), is(), merge(), process(), and unprocessed(), in the bnd extension. For example bnd.get('property') replaces bnd('property').
      • BndPluginConvention will be removed in a future version of the Bnd Gradle plugins.
    • BundleTaskExtention replaces the now deprecated BundleTaskConvention.
      • The properties of the convention should no longer be used and build scripts should be updated to use the equivalent properties in the bundle extension. For example, bundle { bndfile = file('bnd.bnd') } replaces bndfile = file('bnd.bnd').
      • Kotlin DSL support is provided for the BundleTaskExtention in the Bundle task as well as the jar task when the biz.aQute.bnd.builder plugin is applied.
      • BundleTaskConvention will be removed in a future version of the Bnd Gradle plugins.
  • The tasks using bndrun files can now infer values for the -runee and -runrequires instructions when they are not specified. The -runee value is based upon the target Java version of the compileJava task and the -runrequires value is based upon the Bundle-SymbolicName values of the artifacts in the archives configuration which is generally the artifact(s) built by the jar task. This is similar to the behavior of the Bnd Maven plugins.
  • The Bndrun and TestOSGi task types now have a javaLauncher property, like the Test task type, which can be used to specify the java executable to be used for the task.
  • The Bnd Gradle plugins require a minimum of Gradle 6.7 for Java 8 to Java 15, and Gradle 7.0 for Java 16.

Backward compatibility

  • Bndtools is built to run on Eclipse 2020-06 (4.16) or later. So Bndtools 6.0 may not run on older versions of Eclipse.
  • Bndtools m2e is built to run on Eclipse m2e 1.16.0 or later. So Bndtools m2e 6.0 may not run on older versions of Eclipse m2e.
  • The Bnd Maven plugins require a minimum of Maven 3.3.9.
  • The Bnd Gradle plugins require a minimum of Gradle 6.7 for Java 8 to Java 15, and Gradle 7.0 for Java 16.
  • The Bnd Gradle plugins and tasks underwent a large update to modernize their implementations and prepare for Gradle 7 and newer Gradle idioms. All Bnd Gradle task properties are now Gradle Properties and should generally be set using an assignment in your build script. A number of previously deprecated task properties have been removed. The conventions are now deprecated and replaced by extensions. See above for more details.

Known Issues

Clone this wiki locally