From @PropertySource
javadoc
...
Note, however, that explicit registration
of a PropertySourcesPlaceholderConfigurer
via a static @Bean
method is typically only required if you need to customize configuration such as the placeholder syntax, etc. See the "Working with externalized values" section of Configuration @Configuration
's javadocs and "a note on BeanFactoryPostProcessor-returning @Bean methods of Bean @Bean
's javadocs for details and examples. Specifically, if no bean post-processor (such as a PropertySourcesPlaceholderConfigurer
) has registered an embedded value resolver for the ApplicationContext
, Spring will register a default embedded value resolver which resolves placeholders against property sources registered in the Environment
.
...
Well, if simple words if you need set up or get more control over property configuration bean such as PropertySourcesPlaceholderConfigurer
you could define it. Otherwise it can be ommited.But if you use version of Spring prior 4.3.0, this bean has to be declared for resolve @Value
.
For get more details:
I hope it'll a little help you)