SpringBoot提供的三种配置文件格式

1、application.properties(传统格式/默认格式)

e.g.

server.port=80

 

2、application.yml(主流格式、推荐使用)

e.g.

server:

    port:81

 

3、application.yaml

e.g.

server:

    port:82

 

4、SpringBoot配置文件加载顺序

application.properties > application.yml > application.yaml

不同配置文件中相同配置按照加载优先级相互覆盖,不同配置文件中不同配置全部保留。

posted @ 2022-11-18 17:01  Linqylin  阅读(602)  评论(0编辑  收藏  举报