赞
踩
Spring Cloud
构建于 Spring Boot
之上,在 Spring Boot
中有两种上下文,一种是 bootstrap
,另外一种是 application
。
bootstrap.yml/bootstrap.properties
和 application.yml/application.yml
都可以用来配置参数。
bootstrap.yml/bootstrap.properties
:用来程序引导时执行,应用于更加早期配置信息读取。可以理解成系统级别的一些参数配置,这些参数一般是不会变动的。
application.yml/application.yml
:可以用来定义应用级别的, 应用程序特有配置信息,可以用来配置后续各个模块中需使用的公共参数等。
文件名.properties /文件名.yml
文件名相同且同时存在时,先加载.properties
文件,再加载.yml
文件。
若application.yml/.properties
和
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。