[SPR-10964] Port @ConditionalOn... from Spring Boot into Spring Core Created: 07/Oct/13  Updated: 15/Jan/19

Status: Open
Project: Spring Framework
Component/s: Core:DI
Affects Version/s: 4.0 M3
Fix Version/s: 5.x Backlog

Type: New Feature Priority: Minor
Reporter: Eberhard Wolff Assignee: St├ęphane Nicoll
Resolution: Unresolved Votes: 7
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
is duplicated by SPR-16065 Adopt a spring boot Condition Resolved
is related to SPR-11296 Include @ConditionalOnMissingBean and... Open
Days since last comment: 43 weeks ago
Last commented by a User: true
Last updater: Spring Issuemaster


Spring Boot provides many useful Conditional such as @ConditionalOnMissingBean, @ConditionalOnClass etc This should really be in the core framework. It would allow to detect the runtime environment (Java EE server? Which Java EE server?) and tweak the configuration accordingly.

Comment by Phil Webb [ 11/Oct/13 ]

We decided to intentionally leave the majority of the @Conditional implementations in Spring Boot for now whilst we develop them. The @ConditionalOnMissingBean can be particularly problematic as it depends on the order that bean definitions get evaluated. For Spring Boot this is not a problem because we only use it for auto-configuration beans (which are always evaluated last), for user applications it might introduce some very hard to track down bugs.

Comment by Spring Issuemaster [ 14/Jan/19 ]

The Spring Framework has migrated to GitHub Issues. Please visit spring-projects/spring-framework#15592 for further activity, or to subscribe to receive notifications.

Generated at Tue Nov 12 04:21:52 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.