首页 > 技术文章 > 集成 nacos

xiluhua 2020-12-20 20:37 原文

根据 2020年12月16日下午16:00的会议共识:
1. 项目使用 properties 文件作为配置文件。
2. 使用 dataid, ${spring.application.name}-${spring.profiles.active}.${file-extension:properties} 为基础配置。
3. 在日常开发中如果遇到多套环境下的不同配置,可以通过 Spring 提供的 ${spring.profiles.active} 这个配置项来配置区分。

最佳实践:
1. 在 resources 下创建 bootstrap.properties 配置如图:

2. 在 application.properties 配置如图:

 

 3. 登陆 nacos 配置 app_name-dev.properties

 

 完成。

 

推荐阅读