-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Support @Scope @ConfigurationProperties beans #41668
Comments
This is working as designed. The |
The javadoc of
It's not a huge leap from there to |
@snicoll I see your point, that defining |
When using
@ConfigurationProperties
via either@ConfigurationPropertiesScan
or@EnableConfigurationProperties
, bean scope specified via@Scope
is not respected.On the other hand, when defining
@ConfigurationProperties
with additional@Configuration
/@Component
/@Bean
annotation, specified scope is respectedProvided below is a sample application using spring boot 3.3.2
It prints following result
It seems that the following if statement in
ConfigurationPropertiesScanRegistrar
is causing it to behave differentlyand the
registrar
itself registers properties with default scope.The text was updated successfully, but these errors were encountered: