SpringBoot-技术专区-新特配置文件属性跟踪

导读:本篇文章讲解 SpringBoot-技术专区-新特配置文件属性跟踪,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com

背景

当我们使用 spring boot 在多环境打包,配置属性在不同环境的值不同,如下:

spring:
  profiles:
    active: @project.profile@  #根据maven 动态配置profile
---
spring:
  profiles: dev
demo: lengleng_dev
---
spring:
  profiles: prd
demo: lengleng_prd

或者使用 spring cloud 配置中心 (nacos/config)等

(0)
小半的头像小半

相关推荐

极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!