/*
people:
student:
- 张三
- 李四
count: 2
*/
try{
//配置文件路径
File conf = new File("C:/project/myDemo/application.yml");
Yaml yaml = new Yaml();
Map<String,Object> people = yaml.load(new InputStreamReader(new FileReader(conf),StandardCharsets.UTF_8));
List<String> students = (List<String>) people.get("student");
String count = (String) people.get("count");
}catch(Exception e){
logger.error("读取配置文件失败!");
e.printStackTrace();
}