Starting bndrun files using Gradle

Running bndrun files using gradle

Bnd provides gradle tasks to run bndrun files and start an application. When listing all gradle tasks using gradlew tasks, you will find the bndrun tasks in the exports section of the list. Usually the tasks look like run.<bndrun-file-name>.

If you want to start you bndrun-application using gradle you can just call ./gradlew run.launch to launch the launch.bndrun.

Please note, that you may encounter an exception like this when running the gradle task:

Welcome to Apache Felix Gogo

g! gosh: stopping shell and framework

Please read the text below for information about this.

Using the Gogo Shell

In certain situations Gogo breaks when starting the OSGi frameworks with:

Welcome to Apache Felix Gogo

g! gosh: stopping shell and framework

To avoid this, the Gogo shell can be deactivated using the JVM property -Dgosh.args=--nointeractive. You can also add the runproperty to the bndrun file gosh.args=--nointeractive

Alternatively the shell can be run as telnet service. Change the property value like this: gosh.args='-sc telnetd -p7315 start' to run the telnet daemon on port 7315. To connect to the shell, simply run telnet <host> 7315.

Please refer to the Felix Gogo

Gecko Exporter

The Gecko Exporter supports settings to disable or use telnet in the application. Per default, the telnet is activated on port 7315. Just take a look at the bin/gecko.conf file in you exported product.

The Dockerfile exposes this port. If you want to disable that, just change the Dockerfile as well before building an image.

by Ilenia Salvadori, Mark Hoffmann, Jürgen Albert