Apache Karaf / OSGi integration for Vaadin Flow

Hi all,

we are currently investigating the migration of a Vaadin Flow (currently 13.x) Application from Spring to OSGi, Apache Karaf in more detail. There is somme documentation on the Vaadin site https://vaadin.com/docs/v14/flow/osgi/tutorial-osgi-basic.html.
Furthermore, I found this example App in Github https://github.com/vaadin/base-starter-flow-osgi.

The first one I dont really get but the second one (the Github Example) I am able to run. But it starts an “internal” felix server.
As we like Karaf I would like to see a Karaf feature for that, but I’m not able to extract that from the Felix example.
I already raised an issue on the Karaf list here: https://lists.apache.org/thread.html/ddf62343a566e0e5066c5492df8354a1229e0e09a3c76c3e1edb0e7d@<user.karaf.apache.org>

It would be really nice to get Vaadin and Karaf folks to cooperate on this and help each other out.
Has anybody any experience with Vaadin (Flow) on Karaf?


Hi Julian,

it could be a good idea to have some “full-blown Vaadin” Karaf feature definition. However, as far as I understood, one idea of Vaadin 10+ was to make it more granular, so you only need to drag in the components you really need. Of course, there will always be some basic set of bundles which are mandatory, like flow-server, -client, -data, -osgi and some auxiliary libraries. But for the rest, it depends on what you need for your UI. There are separate bundles for the button, the combo box, the grid, the text field etc. You may need some of them in your feature - and you may not need others. So it will be difficult to define a one-fits-for-all Karaf feature for Vaadin. But some template feature(s) from which it can be seen what is mandatory and what is optional would make things easier.

In my opinion, defining the Karaf feature is currently the easier part - although one has to visit the boms to extract the correct versions of bundles to be used for the Karaf feature definition. Defining the pom.xml for the project itself to support production-mode builds and debug-mode build is the more complicated part. At least for now (Vaadin 14). Possibly this will clear up when the compatibility mode will no longer be needed to build OSGi bundles for Vaadin.


Hi Jochen,

thanks for your reply.
The “optimal” ™ solution would be to make all Vaadin jars also karaf bundles, I think.
But for starters a “vaadin-all” feature could be helpful.
Although it would also for other components good to have them as bundles AND as features to also import the bundles they dependent on.

I already spent some work on it and am happily willing to share it with the community as this may save someone some headache and lots of time : )