OBR Scanner

OBR Scanner makes use of Apache Felix OBR implementation.
At the moment the current OBR implementation (1.0.0) is not 100% "production ready".
Also there are few OBR repositories and some of them have incomplete or malformed content.

Overview

The OBR scanner handles a set of bundles listed in plain text file(s) by its symbolic name and an optional version. The scaner will first use OBR to discover and resolve any requirements the listed bundles have.

How does it work

The OBR scanner will parse the provided url and transform the content in OBR valid filters. As OBR makes use of the current available bundles (to satisfy requirements) a prior to framework start resolving process cannot be performed. To overcome this OBR scanner will add two bundles to the list of bundles to be installed:

  • Apache Felix Bundle Repository — OBR implementation used to discover and install resolved bundles
  • Pax Runner OBR Script — uses OBR to discover the bundles that match the prior parsed obr filters.

As the target framework gets started the Pax Runner OBR Script bundle will perform its duty as soon as OBR service become available.

Syntax

scan-obr:file_url[@start_level][@nostart][@update]

where:

  • file_url : mandatory; is the url of the #file containing the list of bundles to be installed;
  • start_level : optional; an integer representing the start level of the bundles present in the pom.
    If present and OSGi Start Level Service is available then the bundle is installed with that specific start level.
    This option overwrites the startLevel #configuration property;
  • nostart : optional; this should be the hardcoded string "nostart" (not case sensitive).
    If present the bundles will not be started.
    This option overwrites the start #configuration property;
  • update : optional; the hardcoded string "update" (not case sensitive)
    If present the bundles will be updated.
    This option overwrites the update #configuration property;

The above options: start_level/nostart/update can be specified in any order.

Examples

  • scan-obr:file:/C:/my-project/my-bundles.txt - installs the bundles contained the file my-bundles from local drive.
  • scan-obr:zip:file:/C:/bundles.zip\!/my-bundles.txt - installs the bundles contained the file my-bundles from a distribution zip file located on the local drive.

File Format

Files containing bundles to be installed must be plain text files containing specifications of the bundles to be installed on separate line, one bundle per line and/or system properties. If system properties are present, those will be carried into the OSGi platform.
The syntax of an bundle reference is as follow:

symbolic_name[/version]

where:

  • symbolic_name : mandatory; is the bundle symbolic name (Bundle-SymbolicName manifest header) of the bundle to be installed.
  • version : optional; version (Bundle-Version manifest header) of the bundle to be installed. If not present and there are more bundles discovered with the same symbolic name, the one with the highest version number will be used.

The syntax of a property is as follow:

-Dproperty-name=property-value

where

  • property-name : the key of the property
  • property-value : the value of the property. The value can contain place holders as ${name} where name is the name of the property the ${name} placeholder will be replaced with.

The file can contain empty lines or lines starting with #, case when those lines will be skipped. This allows nice separation and comments.

File Examples
# install Eclipse Equinox Http Service implementation (the bundle will also be started on default start level)
org.eclipse.equinox.http

# install Eclipse Equinox Http Service implementation version 1.0.100.v20070423 (the bundle will also be started on default start level)
org.eclipse.equinox.http/1.0.100.v20070423

# properties for http service ports
-Dorg.osgi.service.http.port=2080
-Dorg.osgi.service.http.port.secure=2443

Configuration

The service can be configured in two ways: via configuration admin if available and via framework/system properties where the configuration via config admin has priority.

Option key

Description

org.ops4j.pax.runner.scanner.obr.startlevel

optional; default start level

org.ops4j.pax.runner.scanner.obr.start

optional; true/false - if installed bundles should be started or not. Default value is true, so the bundles are started.

org.ops4j.pax.runner.scanner.obr.update

optional; true/false - if installed bundles should be updated or not. Default value is false, so the bundles will not be updated.