6

Is there a way to enable yaml configuration (instead of properties file) in normal spring web mvc application without using spring boot and have the @Value annotation supported.

I searched a lot, everywhere it uses spring boot. I am not intrested to use spring boot, as its very heavy and have many dependancies configured for auto setup.

Any help would be appreciated......

Jan Galinski
  • 11,768
  • 8
  • 54
  • 77
Ysak
  • 2,601
  • 6
  • 29
  • 53
  • Can you clarify what you mean by YAML configuration? Do you mean reading attributes from a YAML file into a bean with the `@Value` annotation? – woemler Jul 21 '15 at 15:05
  • Yes....absolutly, instead of using properties file, I would like to use yaml – Ysak Jul 22 '15 at 07:45
  • Take a look at the answer here: http://stackoverflow.com/a/21272560/1458983 – woemler Jul 22 '15 at 14:09
  • Its not a good solution, i am looking for exactly the same way we use properties files – Ysak Jul 22 '15 at 17:51
  • Well, if you are not willing to use the Spring Boot util classes, I think that you are out of luck. – woemler Jul 22 '15 at 18:08
  • See also: [How to use YamlPropertiesFactoryBean to load YAML files using Spring Framework 4.1?](http://stackoverflow.com/questions/28303758) – approxiblue Aug 08 '15 at 21:12
  • Thanks...I did it as specified in http://stackoverflow.com/questions/28303758 – Ysak Sep 17 '15 at 07:05
  • just take a look at this answer here:[https://stackoverflow.com/questions/21271468/spring-propertysource-using-yaml/54247009#54247009](https://stackoverflow.com/questions/21271468/spring-propertysource-using-yaml/54247009#54247009) .it`s easy to use. – Forest10 Jan 18 '19 at 04:07

0 Answers0