因为项目需要,需要每个微服务对应各自名称的配置文件.所有有了本文.

 

配置文件名称: application-api.properties

 

方法一 : 设置 Active profiles

Intellij Idea配置springBoot多环境/配置文件

 

方法二: Program arguments:输入指令 --spring.profiles.active=api

Intellij Idea配置springBoot多环境/配置文件

 

 

方法三: Environment variables: 输入spring.profiles.active=dev

 

Intellij Idea配置springBoot多环境/配置文件

 

 

 

 

 

 

 

 

 

 

相关文章: