// 读取 application-dev.yml
        Yaml yaml = new Yaml();
        Map dev = yaml.load(new FileInputStream(System.getProperty("user.dir") + "/src/main/resources/application-dev.yml"));
        Map spring = (Map)dev.get("spring");
        Map datasource = (Map)spring.get("datasource");
        String url = (String)datasource.get("url");
        String username = (String)datasource.get("username");
        String password = datasource.get("password") + "";
注意:本文归作者所有,未经作者允许,不得转载
