spring cloud 修改 bootstrap 文件的文件名

前言

  • spring boot 2.1.2.RELEASE

spring cloud 默认的启动文件

spring cloud 默认的启动文件为 bootstrap.yml

修改 bootstrap 文件的文件名

添加参数

--spring.config.location=classpath:bootstrap.yml

或者

--spring.cloud.bootstrap.location=classpath:bootstrap.yml
  • 还可以使用绝对路径

示例

java -jar xxxx.jar --spring.config.location=classpath:bootstrap-dev.yml

或者

java -jar xxxx.jar --spring.cloud.bootstrap.location=classpath:bootstrap-dev.yml

eclipse 示例

在这里插入图片描述

posted @ 2024-06-27 10:32  CharyGao  阅读(20)  评论(0)    收藏  举报