SpringBoot - making a dynamically loaded java plugin SpringBoot aware
posted 1 month ago
I have a Springboot project where various plugins will be compiled seperately and added to the java path at runtime.
I would like those plugins to use the Springboot annotations and for springboot to treat them as it would other annotations - create beans, listeners etc.
is this possible?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have a Springboot project where various plugins will be compiled seperately and added to the java path at runtime.
I would like those plugins to use the Springboot annotations and for springboot to treat them as it would other annotations - create beans, listeners etc.
is this possible?
posted 1 month ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Definitely, that's what the entire auto-configuration mechanism is meant for. You add a single dependency, and it will make sure that all the necessary beans become available. Such "plugins" are often called Spring Boot starters, because Spring Boot uses the same mechanism internally. For example, spring-boot-starter-web for Spring MVC, spring-boot-starter-validation for Bean Validation, spring-boot-starter-security for Spring Security, etc. The main difference is that the "official" starters start with spring-boot-starter, and it's customary for your own own starters to end with spring-boot-starter. The second link below mentions this:
Some useful links:
* https://docs.spring.io/spring-boot/reference/using/auto-configuration.html
* https://docs.spring.io/spring-boot/reference/features/developing-auto-configuration.html
* https://www.baeldung.com/spring-boot-custom-auto-configuration
As a rule of thumb, you should name a combined module after the starter. For example, assume that you are creating a starter for "acme" and that you name the auto-configure module acme-spring-boot and the starter acme-spring-boot-starter. If you only have one module that combines the two, name it acme-spring-boot-starter.
Some useful links:
* https://docs.spring.io/spring-boot/reference/using/auto-configuration.html
* https://docs.spring.io/spring-boot/reference/features/developing-auto-configuration.html
* https://www.baeldung.com/spring-boot-custom-auto-configuration
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
| This parrot is no more. It has ceased to be. Now it's a tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |









