Spring Boot add external views at runtime

A main v24 spring boot app has views locked into the runtime.
Is it possible to add views from an external jar into a running application?

At runtime or at build time? At build time this is no problem. It’s just a dependency

At runtime, for example detect jar added to a watched directory

You cannot change the app during runtime

You could do that at startup time

so you have to extend the classpath of the Spring Boot app

Thanks Simon, I will investigate further.

I think you can do it with OSGI: OSGi | Integrations | Vaadin Docs
But I haven’t used OSGI since Vaadin 7 or 8.

Note: OSGi is currently not supported in 24+ because it has no Jakarta version :see_no_evil:

And IMO that’s a good thing because OSGi may solve a problem but brings many other you didn’t had witout it :sweat_smile:

Couldn’t agree more :grimacing: I personally don’t have good experience with it as well… but I had colleagues that loved it and it still runs in our company

I had to use it because in the early 2000s a lot of companies were using Eclipse RCP to build applications. Eclipse RCP was great but OSGi :scream:

I’m not saying OSGI is easy but that “detect jar added to a watched directory”. I forgot that OSGI wasn’t updated :/

How is the classpath extended before restart? The system is running with a fat jar, no way to change pom.

Please read the Spring Boot docs: The Executable Jar Format