java读取yml
java读取yml文件转map:
java:(获取文件方法linux和Windows通用)
String filepath = new File(ResourceUtils.getURL("classpath:").getPath())+"/tytemmaps.yml";
File tytemmapsFile = new File(filepath);
Map map = Yaml.loadType(tytemmapsFile, HashMap.class);
pom引用:
<dependency>
<groupId>org.jyaml</groupId>
<artifactId>jyaml</artifactId>
<version>1.3</version>
</dependency>