spring boot 加载xml配置文件及注入值

首先解决一下idea新建 yml或是xml没有提示问题

看图标就可以知道 ,两个文件不是一样的,需要下面设置

ctrl+shift+alt+s

初始只有application.yml 没有我后建yml文件

点下面的后框

点击加号,

找到新建 的yml点ok就可以了

完美解决

在启动类上面加上注解

@importresource

原文地址:https://www.cnblogs.com/qin-up/p/10176746.html