Add simple BND task to OSGi plugin


(brmeyer) #1

Currently, we have to include the bnd jar, run it as a JavaExec task, then manually include osgi’d jars in the configuration. It would be great if the OSGi plugin would support manually running BND on a local jar, rather than tying it purely to project manifest generation.

If there’s any interest, I’d be happy to contribute (with a bit of direction).


(Luke Daley) #2

Hi Brett,

Would you mind explaining a little bit more about what kind of workflows this would be useful for?


(brmeyer) #3

Admittedly, the context was somewhat unique, but I’m guessing it comes up in others ways. We just finished up Hibernate OSGi and included unit/integration tests. Hibernate has multiple dependencies that are not OSGi-friendly. Most OSGi containers will allow you to “wrap:” the bundle when you activate it, which simply uses BND to automatically update the manifest. However, the few unit test environment frameworks we worked with (Arquillian and PAX-Exam) do not provide this capability. So, BND needs to be manually run on a few local, controlled jars prior to the test task. It’s also useful when you need to provide .bnd files to tightly control the packages, import/export versions, etc.


(brmeyer) #4

Here’s the specific example. See the *Bnd tasks.

https://github.com/hibernate/hibernate-orm/blob/master/hibernate-osgi/hibernate-osgi.gradle


(Luke Daley) #5

That makes sense.

Would this be something you would be interested in contributing to the plugin?


(brmeyer) #6

Certainly, but may need a bit of direction. Is anyone available to discuss it? IRC? Email?


(brmeyer) #7

Can we open a JIRA for this and I’ll take a stab at it?