Skip to content
BJ Hargrave edited this page Feb 22, 2017 · 15 revisions

Bnd 3.3.0

For Bndtools 3.3.0 changes, see https://github.com/bndtools/bndtools/wiki/Changes-in-3.3.0.

OSGiRepository

A new repository plugin, aQute.bnd.repository.osgi.OSGiRepository, has been added to replace FixedIndexRepo. It serves the same role as FixedIndexRepo but uses the new HttpClient support introduced in Bnd 3.2. Please migrate your use of FixedIndexRepo to aQute.bnd.repository.osgi.OSGiRepository.

BndPomRepository

A new repository plugin, aQute.bnd.repository.maven.pom.provider.BndPomRepository, has been added which creates a repository around a POM file and its transitive dependencies. For example:

-plugin.enroute-distro: aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
  name="enRoute Distro"; \
  pom=org.osgi:osgi.enroute.distro.pom:2.0.0-SNAPSHOT; \
  snapshotUrls=https://oss.sonatype.org/content/repositories/osgi/; \
  releaseUrls=https://repo1.maven.org/maven2/

P2Repository

A new repository plugin, aQute.bnd.repository.p2.provider.P2Repository, has been added so that Eclipse p2 repositories can be used. For example:

-plugin.orbit-neon: aQute.bnd.repository.p2.provider.P2Repository; \
    name = "Orbit (Neon)"; \
    url = "http://download.eclipse.org/tools/orbit/downloads/drops/R20160520211859/repository/"

Bnd Maven Plugin Changes

bnd-export-maven-plugin

A new bnd-export-maven-plugin Maven plugin is added which can export bndrun files. See the README for information on the plugin.

Other Notable Changes

  • A download progress plugin has been added to log Download messages when downloading files from repositories.
  • Exception reporting was improved to provide more information when an exception occurs. The exception will be logged to SLF4J at the DEBUG level, the exception type will be added to the Processor in addition to the exception message and InvocationTargetExceptions will be unwrapped before being added to the Processor.
  • Added -runprovidedcapabilties instruction. These capabilities are added to the resolve system context but are not added the the org.osgi.framework.system.capabilities.extra system property for the runtime.
  • The ${env} macro has been enhanced to allow the specification of a default value if the specified environment variable is not set.
  • The instruction -dsannotations-options: norequirements can be used to disable requirements generation for DS components. The instruction -dsannotations-options: nocapabilities can be used to disable capabilities generation for DS components.

Backwards compatibility

  • Bnd 4.0, planned for Spring 2017, will move to Java 8 as the base runtime.
  • The Bnd DS, metatype and versioning annotations are deprecated and support for them will be removed in Bnd 4.0. Please make plans to migrate to the OSGi Release 6 specified annotations which now offer more features than the bnd annotations.
  • The OSGiRepository replaces the aQute.bnd.deployer.repository.FixedIndexRepo repository plugin which will be deprecated in the future. Please migrate to the OSGiRepository repository plugin.
  • The MavenBndRepository replaces the aQute.bnd.deployer.repository.aether.AetherRepository repository plugin which is now deprecated. Please migrate to the MavenBndRepository repository plugin.
  • The biz.aQute.junit bundle has updated to use Java 6 as the compile target. It was Java 5 in the Bnd 3.2 release.

Known Issues

  • A comment line in a bnd file ending in \ is incorrectly continued onto the next line.
  • In Gradle 3.4, Gradle will remove source set output directories when up upgrade the version of Gradle used to build or if your .gradle folder is remove such as doing git clean -dfx to make a clean build. If you use the Workspace build and have a project with no java source code, then the jar task can fail because the source output folder created by Bnd during Gradle project evaluation has been deleted by Gradle before the jar task executes. The Bnd code called by the jar task assumes the source output folder created earlier still exists. This issue has been fixed for Bnd 3.4. To workaround this issue, add the following to your build.gradle for the jar task:
jar {
  doFirst {
    project.mkdir(compileJava.destinationDir)
  }
}
Clone this wiki locally