# Bnd Native Launcher in a pure maven project

**URL:** <https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186>\
**Category:** GENERAL\
**Created:** [November 2, 2021, 5:36pm UTC](https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186 "2021-11-02T17:36:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwirth](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/mwirth/32/107_2.png) [@mwirth](https://bnd.discourse.group/u/mwirth)\
**Post date:** [November 2, 2021, 5:36pm UTC](https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186/1 "2021-11-02T17:36:46Z")

</div>

I have a pure Maven project with one OSGi bundle. The project has a` bnd.bnd` and a `app.bndrun` file.  
The JAR is created incrementally including the corresponding OSGi headers.

I want to install and start this bundle with the _Bnd Native Launcher_ in karaf. The `app.bndrun` looks like this:

```auto
-runpath: biz.aQute.remote.launcher

-runremote: debug;\
	shell = -1; \
	jdb = 5005; \
	host = localhost; \
	agent = 29998; \
	timeout = 30000

-runee: JavaSE-1.8

-runproperties: gosh.args=--noshutdown

-runtrace: true

-runbundles: \
	karaf-test

```

When I start the launcher, the bundle is installed and started in karaf.

Whenever I change the Java code, the JAR is automatically regenerated. Unfortunately, the bundle will not restart.

I suspect the problem is because the _BuildListeners_ are not being notified. The _BndtooldBuilder_ does this, but this builder is not active in an enroute workspace (maven).

Is there a solution how to aotomatically restart the bundle with the Bnd Native Launcher?

If desired, I can publish an exmaple workspace on github.

---

<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:** [November 2, 2021, 6:07pm UTC](https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186/2 "2021-11-02T18:07:42Z")

</div>

You don’t mention how you are _launching_. That would help us understand the connection between the launcher and builders.

---

<div class="post-metadata">

**Author:** ![mwirth](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/mwirth/32/107_2.png) [@mwirth](https://bnd.discourse.group/u/mwirth)\
**Post date:** [November 2, 2021, 6:10pm UTC](https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186/3 "2021-11-02T18:10:10Z")

</div>

right-click on the posted `.bndrun` file and select `Debug As -> Bnd Native Launcher`

---

<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:** [November 2, 2021, 6:23pm UTC](https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186/4 "2021-11-02T18:23:33Z")

</div>

Could you try `Debug As -> Bnd OSGi Run Launcher`?

---

<div class="post-metadata">

**Author:** ![mwirth](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/mwirth/32/107_2.png) [@mwirth](https://bnd.discourse.group/u/mwirth)\
**Post date:** [November 2, 2021, 7:12pm UTC](https://bnd.discourse.group/t/bnd-native-launcher-in-a-pure-maven-project/186/5 "2021-11-02T19:12:43Z")

</div>

I have no _OSGi Framework_ inside the workspace. I want to install and start the bundle on a karaf running remote.  
Or do I have to add some OSGi Framework to my workspace?

My project is available [here](https://github.com/mwirth/bnd-karaf)
