I can see text appearing in my browser when creating a page, but no theming or components are loaded. I assume this is a problem with loading the WebJars. At the bottom of the page, they describe repackaging all webjars in the application jar, but I do not have a ‘single’ application jar, my application has multiple jars. Next to that I’m not using Maven, but BNDTools.
Can anyone point me in the correct direction on how to get this up-and-running?
So, all resources have been packaged into an OSGi compatible jar (and resources itself have been ocpied into META-INF/resources/frontend/bower_components/…), but they don’t get discovered.
You are using Flow version where themes are not yet OSGi compatible themselves. This ticket has been fixed recently.https://github.com/vaadin/flow/issues/4809. Please make sure you are using version which has this fix.
I’m not sure about the way how you repackage the resources. Please make sure that the resources are available via HTTP.
You may also check your network tab in Chrome dev tools: which resources are requested and which exist (not 404).
If frontend/bower_components/vaadin-button/theme/lumo/vaadin-button.html is not requested at all then it means your theme jar is just not OSGi compatible most likely.
Thanks for the reply. I added all files in the (repackaged) jars as static resources by implementing OsgiVaadinContributor and this seems to work. However, this list is very long (hundreds of files). Isn’t there a better way?
Next to that, my application seems already ‘more’ styled, but not completely yet (see screenshot, page contains an ‘h1’ and a Vaadin Button). The fonts are correct, but the button is not styled yet as it should. My developer console is not showing any resources it cannot find. Any idea?
Well, we are suggesting another way of handling webjars in OSGi (at least it works with felix-jetty).
Just put all your resources into the bundle root.
The result of this config is : frontend becomes a folder inside a bundle root and it’s available via HTTP without more efforts.
I’m not sure about the exact way of your repackaging but if you have one folder with all bower_components in one location then you may just register META-INF/resources/frontend/bower_components folder via OsgiVaadinContributor.