来源:

https://blog.csdn.net/liu911025/article/details/81489454

 

一.springBoot启动在Program arguments:输入指令--spring.profiles.active=dev

 

Idea配置SpringBoot多环境的切换的五种方案_java

 

二. springBoot启动在Active Profiles:输入dev

 

Idea配置SpringBoot多环境的切换的五种方案_java_02

 

三.springBoot启动在Environment variables: 输入spring.profiles.active=dev

 

Idea配置SpringBoot多环境的切换的五种方案_java_03

 

四.maven启动Environment variables: 输入spring.profiles.active=dev

 

Idea配置SpringBoot多环境的切换的五种方案_java_04

 

Idea配置SpringBoot多环境的切换的五种方案_java_05

 

五.maven启动Skip tests下输入spring.profiles.active=dev

 

Idea配置SpringBoot多环境的切换的五种方案_java_06

https://mp.weixin.qq.com/s/sSuutKoAWrZUk2A5NSud0A