# Wrapping JARs in Bntools

**URL:** <https://bnd.discourse.group/t/wrapping-jars-in-bntools/61>\
**Category:** TIPS\
**Created:** [December 23, 2020, 11:10am UTC](https://bnd.discourse.group/t/wrapping-jars-in-bntools/61 "2020-12-23T11:10:00Z")\
**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:** [December 23, 2020, 11:10am UTC](https://bnd.discourse.group/t/wrapping-jars-in-bntools/61/1 "2020-12-23T11:10:00Z")

</div>

In my [previous post](https://bnd.discourse.group/t/when-it-is-not-a-bundle/59) I showed how to use a non-OSGi JAR. A question was what the purpose of this?

In OSGi you can wrap bundles very easily by including the _whole bundle_ in one fell swoop.

```
-includeresource \
       @${repo;org.apache.mina:mina-core}

```

The `@` function takes a file path and _unrolls_ the JAR in the bundle. I.e. it copies all the entries in that JAR in the bundle you’re bundle. Afterwards it will calculate imports and exports. The `${repo}` macro takes a Bundle Symbolic Name and an optional version and provides the file path.

---

<div class="post-metadata">

**Author:** ![peterkir](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/peterkir/32/28_2.png) [@peterkir](https://bnd.discourse.group/u/peterkir)\
**Post date:** [December 24, 2020, 8:28am UTC](https://bnd.discourse.group/t/wrapping-jars-in-bntools/61/2 "2020-12-24T08:28:05Z")

</div>

Great! Wrapping and including bundles since years. But there are always new gems - `$repo` macro inside bnd🤩  
Thx for sharing!
