Spring -boot Remove location attributes from @ConfigurationProperties

Remove Location Attributes from @ConfigurationProperties

What are the alternatives?

I used it as before.

@ConfigurationProperties(locations = "a.yml") 
+6
source share
1 answer

Same problem: we have hundreds of configuration keys in several yaml files, each of which is conveniently mapped to pojo, which we introduce into our beans business logic.

The best thing I could do to upgrade to Spring Boot 1.5 and at the same time keep our production application working without much refactoring is described here: http://fabiomaffioletti.me/blog/2016/12/20/spring-configuration -properties-handle-deprecated-locations /

Or, if this does not work for you, you can try this method, which is easier, even if you need more refactoring (remove the @ConfigurationProperties annotation): http://fabiomaffioletti.me/blog/2017/02/09/spring-configuration- properties-locations-deprecation-another-approach /

+3
source

Source: https://habr.com/ru/post/1014757/


All Articles