如下图,可以创建多个环境的配置文件:
application.yml 中定义当前使用环境如下:
-
spring:
-
application:
-
name: xxx-server
-
profiles:
-
active: dev #当前环境
-
async:
-
executor:
-
pool:
-
core-size:
10
-
max-size:
60
-
keep-alive-seconds:
60
-
queue-capacity:
10
-
server:
-
port:
8088
运行时选择配置文件如下:
java -jar xxx-server-1.0.0.jar --spring.profiles.active=test
转载:https://blog.csdn.net/msllws/article/details/110959058
查看评论