# More convenience for Maven Repos

**URL:** <https://bnd.discourse.group/t/more-convenience-for-maven-repos/435>\
**Category:** TIPS\
**Created:** [April 4, 2024, 3:56pm UTC](https://bnd.discourse.group/t/more-convenience-for-maven-repos/435 "2024-04-04T15:56:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pkriens](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/pkriens/32/3_2.png) [@pkriens](https://bnd.discourse.group/u/pkriens)\
**Post date:** [April 4, 2024, 3:56pm UTC](https://bnd.discourse.group/t/more-convenience-for-maven-repos/435/1 "2024-04-04T15:56:24Z")

</div>

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`](https://bndtools.org/concepts.html#workspacerepositoriesproject-model) 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.

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/67f31c7de5222e2cccf88b79ac9db446a40ddf3c.png)

For example, to add some dependencies to Maven Central you can create a file `cnf/ext/example.pmvn`:

```auto
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.

![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/30ab7bc6021ae732e1aa7be51b29740f5ff8ee95.png)

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.

```auto
# 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](https://bnd.bndtools.org/plugins/maven.html)

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.

---

<div class="post-metadata">

**Author:** ![chrisrueger](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/chrisrueger/32/18_2.png) [@chrisrueger](https://bnd.discourse.group/u/chrisrueger)\
**Post date:** [April 10, 2024, 1:41pm UTC](https://bnd.discourse.group/t/more-convenience-for-maven-repos/435/2 "2024-04-10T13:41:26Z")

</div>

On that note a little additional update:  
There has also been some work in [BndEditor build.bnd: Plugin list should detect plugins by prefix by chrisrueger · Pull Request #6069 · bndtools/bnd · GitHub](https://github.com/bndtools/bnd/pull/6069) to make managing the Plugins in `build.bnd` easier. This means:

- now you see the Plugins (before this was only working without merged properties)
- also inherited repositories are shown greyed out
- you can edit plugins (also works for MavenBndRepository)
- remove plugins

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/24e1d6776489d3bbd166408d416c4a0f218b03f8.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/1282abb86eb81a8648a51a729654a1616a94fe2c.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/bnd/original/1X/0b2ff32f0ed898326700ff7a4a056cf1a9ba9ed9.png)

Hoping both of the above and this improve usability of managing repositories.  
This is in the latest snapshot.

Together with Peter’s work on a new _Workspace Fragment Template support_ mechanism this adds new ways to extend and configure a bndtools workspace. Looking forward how this will look when it all comes together.
