1、使用profile的方式、
application-{profile}.properties
profile 代表的是环境变量
比如:application-dev.properties 表示开发环境
application-test.properties 表示测试环境
打包
执行的命令:java - jar xxx.jar --spring.profiles.active=yy
xxx:打包后的jar包的名称
yy:环境变量的名称,比如dev和test