-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Include @ConditionalOnMissingBean and @ConditionalOnClass from Spring Boot [SPR-11296] #15920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oliver Drotbohm commented /cc Dave Syer |
Dave Syer commented One problem is that |
I have tagged this issue with the After a discussion, with @dsyer and @wilkinsona, I am tempted to think that for most use cases we could replace import selectors by providing more advanced conditions in Spring Framework (inspired by Spring Boot one), in order to make it possible for Spring portfolio projects to selectively register bean definitions as requested by @odrotbohm. That would also increase the maintainability and the expressiveness of Spring configurations. I guess that will trigger questions like what conditions should be moved to Framework. Maybe also this could create an opportunity to see if we should support those conditions more natively without requiring |
This probably isn't something we can easily do in Boot 2.x/Framework 5.x since our conditions in Boot contribute to an auto-configuration report. It would be a good 6.x candidate I think. |
Oliver Drotbohm opened SPR-11296 and commented
@ConditionalOnMissingBean
and@ConditionalOnClass
allow to selectively register bean definitions in case a different bean definition is already registered or a type being present on the classpath.This is really useful to ecosystem projects to be able to pick up user configuration or fall back to defaults otherwise without necessarily creating a dependency on Spring Boot (which might cause a cyclic dependency if boot provides additional defaulting).
Issue Links:
@ConditionalOn
... from Spring Boot into Spring Core5 votes, 7 watchers
The text was updated successfully, but these errors were encountered: