Combining bnd-maven-run-plugin and Atomos

Hello!

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

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

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

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

Now if you added:

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

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

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:

]$ 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!