I found this SPR where Chris Beams states why PropertySourcesPlaceholderConfigurer should not be registered automatically by Spring and why one should prefer user Environment
over @value
.
In addition, on Spring reference documentation, the Spring Testing Annotation section shows how to use ApplicationContextInitializer
, which could be used to setup YamlPropertiesFactoryBean
properly.
Read full article from java - Setting up Spring 4.1 profile environment using YAML instead of Properties and @Profile - Stack Overflow
No comments:
Post a Comment