The MavenBndRepository is one of the bnd workhorses. However, it is always kind of work to setup the plugin and the separate Maven Group:Artifact:Version
file feels a bit superfluous. You can set the GAVs in the bnd file with the source option but there should be a better way …
I’ve just committed new version of bnd that will look for file that end in .pmvn
in the cnf/ext
directory. The ext
directory was already used to extend the properties with bnd files. If you add a bnd file, then the workspace would have those properties as base.
For example, to add some dependencies to Maven Central you can create a file cnf/ext/example.pmvn
:
biz.aQute.bnd:biz.aQute.bndlib:7.0.0
biz.aQute.bnd:aQute.libg:7.0.0
biz.aQute.bnd:biz.aQute.launchpad:7.0.0
biz.aQute.bnd:biz.aQute.bnd.runtime.gogo:7.0.0
biz.aQute.bnd:biz.aQute.bnd.runtime.snapshot:7.0.0
biz.aQute:biz.aQute.osgi.templates:1.10.0
If you run the latest the latest snapshot (7.1, later dan April 4) in Bndtools, then you should see a example.pmvn
repository.
In this case the defaults are used but you can set specific properties in the comments. For example, to add a releaseUrl
and the name, you could do the following.
# name = Example
# releaseUrl = https://repo.maven.apache.org/maven2/
biz.aQute.bnd:biz.aQute.bndlib:7.0.0
biz.aQute.bnd:aQute.libg:7.0.0
biz.aQute.bnd:biz.aQute.launchpad:7.0.0
biz.aQute.bnd:biz.aQute.bnd.runtime.gogo:7.0.0
biz.aQute.bnd:biz.aQute.bnd.runtime.snapshot:7.0.0
biz.aQute:biz.aQute.osgi.templates:1.10.0
The property names are defined in the Maven Bnd Repository
The same mechanism also works for the OSGiRepository. You can dump an OBR XML file but give it the extension pobr
. The reason for these ‘odd’ extensions is that before this release, only .bnd
files were inspected and it was common to add the data files in the same ext
directory.