在使用springboot的时候可以使用属性文件配置对属性值进行动态配置,官方文档原文如下:
Spring Boot uses a very particular PropertySource
order
that is designed to allow sensible overriding of values, properties are considered in the the following order:
System.getProperties()
).@PropertySource
annotations
on your @Configuration
classes.application.properties
including
YAML and profile variants).application.properties
including
YAML and profile variants).SpringApplication.setDefaultProperties
).PropertySource
初识spring boot maven管理--属性文件配置,布布扣,bubuko.com
原文:http://blog.csdn.net/cml_blog/article/details/23736929