一、Properties配置形式
# 常见的配置项
# 端口
server.port=8080
# 项目的contentpath路径
server.servlet.context-path=/demo
# 开启debug模式
debug=true
# 配置日志级别,为debug
logging.level.com.example=debug
# properties配置文件内容回顾
#配置简单的key-value
person.name=zhoukun
person.age=18
person.sex=female
person.birthday=1949/10/01
#配置字符串数组
person.citys[0]=beijing
person.citys[1]=xizang
person.citys[2]=dongwan
#配置集合
person.animals[0].name=dog
person.animals[0].age=2
person.animals[1].name=tiger
person.animals[1].age=3
#配置map
person.map.k1=value1
person.map.k2=value2
二、简单yaml配置形式
username1: zhoukun
person.name: zhoukun
person.age: 18
person.sex: female
person.birthday: 1949/10/01
person.citys:
- beijing
- xizang
- dongwan
person.animals:
- name: dog
age: 2
- name: tiger
age: 3
person.map.k1: value1
person.map.k2: value2
三、简版yaml配置形式
myname: zhoukun
myage: 18
mysex: female
person:
name: zhoukun
age: 18
sex: female
birthday: 1949/10/01
citys:
- beijing
- xizang
- dongwan
animals:
- name: dog
age: 2
- name: tiger
age: 3
map:
k1: value1
k2: value2