【问题】SpringBoot Maven 多模块下 yml 文件读取问题

 

 

如果在依赖的多个模块中都有application.yml文件时,只读取有主启动类的yml文件,不会读取其它模块中的yml配置文件

 

解决方案:
第一步:修改其他模块中的yml文件的名字为application-xxx.yml
第二步:在主启动模块中的application.yml中配置如下内容

spring:
   profiles:
    active: xxx


即可解决springBoot中多模块配置文件中读取配置文件问题
 

 

 

 

 

 

 

你可能感兴趣的:(问题异常,spring,boot,spring)