# Add simple BND task to OSGi plugin

**URL:** <https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516>\
**Category:** Old Forum Archive\
**Created:** [July 3, 2013, 5:54pm UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516 "2013-07-03T17:54:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Meyer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brett_meyer/32/183_2.png) [@Brett\_Meyer](https://discuss.gradle.org/u/Brett_Meyer)\
**Post date:** [July 3, 2013, 5:54pm UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/1 "2013-07-03T17:54:00Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [July 20, 2013, 6:58pm UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/2 "2013-07-20T18:58:00Z")

</div>

Hi Brett,

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

---

<div class="post-metadata">

**Author:** ![Brett\_Meyer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brett_meyer/32/183_2.png) [@Brett\_Meyer](https://discuss.gradle.org/u/Brett_Meyer)\
**Post date:** [July 23, 2013, 4:06am UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/3 "2013-07-23T04:06:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Brett\_Meyer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brett_meyer/32/183_2.png) [@Brett\_Meyer](https://discuss.gradle.org/u/Brett_Meyer)\
**Post date:** [July 23, 2013, 4:08am UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/4 "2013-07-23T04:08:00Z")

</div>

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

[https://github.com/hibernate/hibernate-orm/blob/master/hibernate-osgi/hibernate-osgi.gradle](https://github.com/hibernate/hibernate-orm/blob/master/hibernate-osgi/hibernate-osgi.gradle)

---

<div class="post-metadata">

**Author:** ![luke\_daley](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/luke_daley/32/9890_2.png) [@luke\_daley](https://discuss.gradle.org/u/luke_daley)\
**Post date:** [August 5, 2013, 12:30pm UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/5 "2013-08-05T12:30:00Z")

</div>

That makes sense.

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

---

<div class="post-metadata">

**Author:** ![Brett\_Meyer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brett_meyer/32/183_2.png) [@Brett\_Meyer](https://discuss.gradle.org/u/Brett_Meyer)\
**Post date:** [August 5, 2013, 2:26pm UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/6 "2013-08-05T14:26:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brett\_Meyer](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/brett_meyer/32/183_2.png) [@Brett\_Meyer](https://discuss.gradle.org/u/Brett_Meyer)\
**Post date:** [September 6, 2013, 2:01pm UTC](https://discuss.gradle.org/t/add-simple-bnd-task-to-osgi-plugin/516/7 "2013-09-06T14:01:00Z")

</div>

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