GH-74 - Discover plugin registries automatically - #154
Open
Adrastopoulos wants to merge 2 commits into
Open
Conversation
Discover plugin interfaces from Spring-managed beans and expose their registries through Spring Boot auto-configuration. Explicit registry beans still take precedence. Closes spring-projectsgh-74 Signed-off-by: Gabriel Hall <gabriel.hall@cox.net>
Follow Spring Shell and Spring Statemachine naming for optional Boot auto-configuration modules. Signed-off-by: Gabriel Hall <gabriel.hall@cox.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spring Boot applications currently need
@EnablePluginRegistrieseven when component scanning has registered each plugin implementation. Component scanning discovers implementation beans, but it does not create the typedPluginRegistrybean. So I attempted to address that here.Added a Spring Boot integration module that discovers the direct
Plugininterfaces implemented by Spring beans. The auto-configuration registers one typed registry for each interface and preserves an explicit registry bean, reusing the existing registry factory, bean name, qualifier, and delimiter type rules.Regarding the module structure, I referenced other Spring projects that own optional Boot integration alongside their core module. For example, Spring Shell publishes
spring-shell-coreandspring-shell-core-autoconfigure; Spring Statemachine usesspring-statemachine-coreandspring-statemachine-autoconfigure. Hence a cosmetic followup to this PR might be renaming/coretospring-plugin-core/and so on and so forth.Test plan:
./mvnw -B clean verify -Pci,nullawayCloses gh-74