v2dev
V2EX  ›  Java

spring 多环境配置管理最佳实践是什么?

  •  
  •   v2dev · Apr 2, 2020 · 4262 views
    This topic created in 2417 days ago, the information mentioned may be changed or developed.

    遇到越来越复杂的项目,不同的环境、不同的分支都会有不同的配置文件,管理起来也越来越混乱,想请教各位前辈有没有比较好的管理思路

    12 replies  •  2020-04-03 14:25:19 +08:00
    Smilencer
    Smilencer
    Apr 2, 2020
    1
    maven profile 或者 spring profile,二选一
    Jafee
    Jafee
    Apr 2, 2020
    2
    使用 spring profile 方便点吧,每个环境一个配置文件。
    Yuicon
    Yuicon
    Apr 2, 2020
    3
    配置中心
    saximoer
    saximoer
    Apr 2, 2020
    4
    配置中心+10086
    根据 profile 区分即可
    sprit
    sprit
    Apr 2, 2020
    5
    Apollo
    rockyou12
    rockyou12
    Apr 2, 2020
    6
    spring cloud config + profile 功能可以拯救你
    huskyui
    huskyui
    Apr 2, 2020
    7
    后辈来一句 spring cloud config
    Aresxue
    Aresxue
    Apr 2, 2020
    8
    不超过十个 spring 自己够用, 超过十个上个配置中心好了, 比如 nacos
    chendy
    chendy
    Apr 2, 2020
    9
    spring 自己的 profile + 配置中心
    xuanbg
    xuanbg
    Apr 2, 2020
    10
    最简单的解决方案就是 spring cloud config
    yiyi11
    yiyi11
    Apr 3, 2020 via Android
    11
    用配置中心,国产的 nacos,apollo,外国的 consul 。纯用做配置管理的话 apollo 最好,但是 nacos 和 consul 还有个好处是它们还是服务注册中心,所以看你的项目技术栈选择。
    Masonnn
    Masonnn
    Apr 3, 2020
    12
    Apollo +1
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1136 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 17:57 · PVG 01:57 · LAX 09:57 · JFK 12:57
    ♥ Do have faith in what you're doing.