# Debug test bndrun when using bnd-testing-maven plugin

**URL:** <https://bnd.discourse.group/t/debug-test-bndrun-when-using-bnd-testing-maven-plugin/242>\
**Category:** GENERAL\
**Created:** [May 11, 2022, 8:37pm UTC](https://bnd.discourse.group/t/debug-test-bndrun-when-using-bnd-testing-maven-plugin/242 "2022-05-11T20:37:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/alexander/32/138_2.png) [@Alexander](https://bnd.discourse.group/u/Alexander)\
**Post date:** [May 11, 2022, 8:37pm UTC](https://bnd.discourse.group/t/debug-test-bndrun-when-using-bnd-testing-maven-plugin/242/1 "2022-05-11T20:37:08Z")

</div>

Hi all,

We rely heavily on maven in our projects, and are using the bnd-maven plugins for OSGi development. This all works great, however now we are looking for a way to debug bndrun files used for testing.

We use the junit-platform tester, and I tried adding the agentlib to the runvm property. And while this adds the correct info when running a mvn verify (at least, so it seems), it fails with an error indicating that the dt\_socket library cannot be found.

Is there some other way to debug a bndrun while using maven?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![rotty3000](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rotty3000/32/16_2.png) [@rotty3000](https://bnd.discourse.group/u/rotty3000)\
**Post date:** [May 11, 2022, 9:28pm UTC](https://bnd.discourse.group/t/debug-test-bndrun-when-using-bnd-testing-maven-plugin/242/2 "2022-05-11T21:28:55Z")

</div>

If you are using the bnd-testing-maven-plugin you can do something like:

```auto
mvn -D-runjdb=8000 bnd-testing:testing -pl jax-rs.itests/

```

Let us know if you are using the bnd-testing-maven-plugin or not.

---

<div class="post-metadata">

**Author:** ![Alexander](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/alexander/32/138_2.png) [@Alexander](https://bnd.discourse.group/u/Alexander)\
**Post date:** [May 11, 2022, 9:38pm UTC](https://bnd.discourse.group/t/debug-test-bndrun-when-using-bnd-testing-maven-plugin/242/3 "2022-05-11T21:38:51Z")

</div>

I now see I did not mention it explicitly, but yes, we do use the testing plugin.

I’ve added -D-runjdb to my mvn verify, and now it indeed waits for the debugger to attach! Many thanks for the quick reply!

Knowing what to look for made it also easy to find the documentation ([-runjdb ADDRESS | bnd](https://bnd.bndtools.org/instructions/runjdb.html)). It seems to be hidden quite well…

---

<div class="post-metadata">

**Author:** ![rotty3000](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/rotty3000/32/16_2.png) [@rotty3000](https://bnd.discourse.group/u/rotty3000)\
**Post date:** [May 11, 2022, 9:41pm UTC](https://bnd.discourse.group/t/debug-test-bndrun-when-using-bnd-testing-maven-plugin/242/4 "2022-05-11T21:41:52Z")

</div>

@Alexander the bnd team gladly accepts any contributions that help improve the documentation, which is here: [bnd/docs at master · bndtools/bnd · GitHub](https://github.com/bndtools/bnd/tree/master/docs) 😀 😉
