eclipse
鼠标点击项目右键—>Run As—>Run Configurations—>Java Application
鼠标右键点击Java Application————>点击 new
在箭头指向的Name处填写你要定义的名字(最好使用Spring Boot项目名称)
在箭头指向的Main class处填写你的启动类的路径
配置参数:
两种方法:
方法一: 指定用application-test.yml启动项,点击Arguments 在Program arguments 中配置参数
'--spring.profiles.active=test'即可;
方法二: 指定用application-test.yml启动项,点击Arguments 在VM arguments 中配置参数
'-Dspring.profiles.active=test'即可;
IDEA
点击项目-->顶部工具栏RUN-->edit Configurations--->Templates--->Application,选择main class,Program arguments配置
--spring.profiles.active=test
————————————————
版权声明:本文为CSDN博主「0-18-0」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_26702601/article/details/88836177