Skip to content
Peter Kriens edited this page May 31, 2013 · 1 revision

bnd has a facility to compare the a build version against a repo version of the jar, this is called baselining. The jars are compared for changes in their public API. If the new version does not match the semantic version rules for the API changes, then an error is reported with the details which package is in error.

You can setup baselining in the following way:

 -baseline: *
 -releaserepo: JPM

-baseline

The -baseline header provides instructions that are matched against the jars build in the project. You can put this anywhere in the build chain (cnf, project, bnd descriptor). In general this field is set to *. There is a magic constant none that indicates an empty list (to override a setting in a higher level descriptor).

An instruction in the -baseline header can have attributes that are used if the instruction matches the bundle symbolic name. The following attributes are supported:

 version               The version to be baselined again
 file                  A file path to baseline against

If no file nor version is specified then the last version from the repository is used, the so called target version. Errors are raised if the target version is higher than the current version.

-baselinerepo

The target jar is searched in the release repo. The default release repo is the first writable repo. This can be overridden with the -releaserepo macro. Since the release repo might be different than the baseline repo, if is possible to use another repo for the baseline with the -baselinerepo macro. For example, the following sets the baseline repo explicitly to the JPM repo.

 -baselinerepo: JPM

Issues

Currently the GUI does not specifically report any issues with the baselining, the only information is the text from the error message. However, it is planned to provide markers for baselining. Both the packageinfo and the violating source change should be marked.

Clone this wiki locally