代码位置:https://github.com/Kevin-Karl-Wang/springboot-jpa
application.yml文件内容:
test read ymlfile
fruit:
name: apple
amount: 5
自定义的属性和值
myProps:
simpleProp: simplePropValue
arrayProps: 1,2,3,4,5
listProp1:
- name: abc
value: abcValue
- name: efg
value: efgValue
listProp2:
- config2Value1
- config2Vavlue2
mapProps:
key1: value1
key2: value2
server:
port: 8080
address: localhost
context-path: /springboot-jpa
1.@value注解
访问路径:http://localhost:8080/springboot-jpa/testyml
2.javaBean: