How can I create a spring-boot application which can be easily extended with plugins?

by schneidolf   Last Updated April 16, 2019 06:05 AM

I am planning a spring boot application that can be extended with plugins. However, I haven't found out yet whether spring boot meets my requirements in this regard.

I imagine the following folder structure:

  • application
    • core <-- core jars
      • main_application.jar
      • ...
    • plugins
      • PluginTypA <-- pluginTypA jars
      • PluginTypB <-- pluginTypB jars
      • PluginTypC <-- pluginTypC jars
      • ...
    • ...

Does Spring Boot provide a way for the core application to automatically detect and load these plugins? How can I get the annotated classes of my plugins to be included in the ApplicationContext of the core application?

Update: When I develop the core application, I don't know which plugins are developed in future and which package name they will have. So the core application has to get known about the plugins on runtime or startup and add the Components to the ApplicationContext.

Example: My coreApplication provides a plugin type for importing data. Actual there is just the need to import .csv files. In one year i get the requirement to import .xlsx files. I don't want to update the whole application, i just want to write a plugin, package it and then copy it to the folder of the plugin type and restart my core application.

Related Questions

Updated May 21, 2019 06:05 AM

Updated September 28, 2018 10:05 AM

Updated March 25, 2019 02:05 AM

Updated October 01, 2018 21:05 PM

Updated November 01, 2018 05:05 AM