加载yml格式的自定义配置文件 加上以下配置文件类 public class YamlPropertySourceFactory implements PropertySourceFactory { @Override public PropertySource< ? > createPropertySource(String name, EncodedResource resource) throws IOException { Properties propertiesFromYaml =