# Combining bnd-maven-run-plugin and Atomos

**URL:** https://bnd.discourse.group/t/combining-bnd-maven-run-plugin-and-atomos/227
**Category:** GENERAL
**Created:** [March 22, 2022, 2:13pm UTC](https://bnd.discourse.group/t/combining-bnd-maven-run-plugin-and-atomos/227 "2022-03-22T14:13:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![io7m](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/io7m/32/129_2.png) [@io7m](https://bnd.discourse.group/u/io7m)
#### Post date: [March 22, 2022, 2:13pm UTC](https://bnd.discourse.group/t/combining-bnd-maven-run-plugin-and-atomos/227/1 "2022-03-22T14:13:31Z")

</div>

Hello!

Does anyone know the right way to combine the bnd-maven-run-plugin with  
Felix Atomos?

> **[GitHub - apache/felix-atomos: Apache Felix Atomos](https://github.com/apache/felix-atomos)**
>
> Apache Felix Atomos. Contribute to apache/felix-atomos development by creating an account on GitHub.

It’s a bit of an unusual one because it requires passing in an instance  
of Atomos to the framework configuration parameters, and it’s not clear  
to me if that’s even possible using bnd-maven-run-plugin. Specifically,  
I’m interested in using Atomos in combination with hot code reloading  
as described in the blog post I wrote ages ago:

[https://blog.io7m.com/2019/05/16/instant-code-reloading.xhtml](https://blog.io7m.com/2019/05/16/instant-code-reloading.xhtml)

---

<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: [March 22, 2022, 3:53pm UTC](https://bnd.discourse.group/t/combining-bnd-maven-run-plugin-and-atomos/227/2 "2022-03-22T15:53:49Z")

</div>

This only requires configuration in order to work.

Take a look at this project: [GitHub - rotty3000/osgi-config-aff: A complete prototype integrating OSGi Configuration Admin with Kubernetes](https://github.com/rotty3000/osgi-config-aff)

Compare the differences between `base.bndrun` and `exec.bndrun` (the second adds Atomos).

Now if you added:

```xml
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-run-maven-plugin</artifactId>
				<version>${bnd.version}</version>
				<executions>
					...
					<execution>
						<id>connect</id>
						<configuration>
							<includeDependencyManagement>true</includeDependencyManagement>
							<bndrun>exec.bndrun</bndrun>
						</configuration>
					</execution>
				</executions>
			</plugin>

```

then `mvn verify bnd-run:run@connect` should work as you expect.

(I am trying to commit this small change so you can see it working but github is having issues presently)

---

<div class="post-metadata">

### Author: ![io7m](https://yyz2.discourse-cdn.com/free1/user_avatar/bnd.discourse.group/io7m/32/129_2.png) [@io7m](https://bnd.discourse.group/u/io7m)
#### Post date: [March 22, 2022, 4:18pm UTC](https://bnd.discourse.group/t/combining-bnd-maven-run-plugin-and-atomos/227/3 "2022-03-22T16:18:22Z")

</div>

Ah, thank you! I’ll give it a try.

---

<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: [March 22, 2022, 5:07pm UTC](https://bnd.discourse.group/t/combining-bnd-maven-run-plugin-and-atomos/227/4 "2022-03-22T17:07:44Z")

</div>

change was committed, so now just `mvn verify bnd-run:run@connect` should work.

to prove it is working you can do: `telnet localhost 11311` then `lb -l` to see the bundle locations.

you should see:

```auto
]$ telnet localhost 11311
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
____________________________
Welcome to Apache Felix Gogo

g! lb -l
START LEVEL 1
   ID|State |Level|Location
    0|Active | 0|System Bundle|3.17.200.v20220215-2237
    1|Installed | 1|atomos:boot:/home/rotty/projects/osgi-config-aff/target/tmp/run/exec/cnf/cache/6.2.0/bnd-cache/biz.aQute.launcher/biz.aQute.launcher-6.2.0.jar|6.2.0.202202251641
    2|Resolved | 1|atomos:boot:/home/rotty/.m2/repository/ch/qos/logback/logback-classic/1.2.8/logback-classic-1.2.8.jar|1.2.8
    3|Resolved | 1|atomos:boot:/home/rotty/.m2/repository/ch/qos/logback/logback-core/1.2.8/logback-core-1.2.8.jar|1.2.8
    4|Resolved | 1|atomos:boot:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.atomos/1.0.0/org.apache.felix.atomos-1.0.0.jar|1.0.0
    5|Resolved | 1|atomos:boot:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.logback/1.0.6/org.apache.felix.logback-1.0.6.jar|1.0.6
    6|Resolved | 1|atomos:boot:/home/rotty/.m2/repository/org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar|1.7.32
    7|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.configadmin/1.9.22/org.apache.felix.configadmin-1.9.22.jar|1.9.22
    8|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.configadmin.plugin.interpolation/1.2.2/org.apache.felix.configadmin.plugin.interpolation-1.2.2.jar|1.2.2
    9|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.converter/1.0.18/org.apache.felix.converter-1.0.18.jar|1.0.18
   10|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.fileinstall/3.7.4/org.apache.felix.fileinstall-3.7.4.jar|3.7.4
   11|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.gogo.command/1.1.2/org.apache.felix.gogo.command-1.1.2.jar|1.1.2
   12|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.gogo.runtime/1.1.4/org.apache.felix.gogo.runtime-1.1.4.jar|1.1.4
   13|Active | 1|reference:file:/home/rotty/.m2/repository/org/apache/felix/org.apache.felix.gogo.shell/1.1.4/org.apache.felix.gogo.shell-1.1.4.jar|1.1.4
   14|Active | 1|reference:file:/home/rotty/.m2/repository/org/osgi/org.osgi.util.function/1.2.0/org.osgi.util.function-1.2.0.jar|1.2.0.202109301733

g! 

```
