Maven启动指定Profile经过-P,如mvn spring-boot:run -Ptest
,但这是Maven的Profile。java
若是要指定spring-boot的spring.profiles.active
,则必须使用mvn spring-boot:run -Drun.profiles=test
spring
若是使用命令行直接运行jar文件,则使用java -jar -Dspring.profiles.active=test demo-0.0.1-SNAPSHOT.jar
spring-boot
若是使用开发工具,运行Application.java文件启动,则增长参数--spring.profiles.active=test
工具