在不启用 config first bootstrap 的情况下覆盖属性的一种更简洁的方法是在来自 config server 的配置中使用属性占位符。spring-doc.cn

例如,如果来自配置服务器的配置包含以下属性spring-doc.cn

hello=${app.hello:Hello From Config Server!}

您可以通过在本地应用程序配置中设置来覆盖 from the config server 的值helloapp.hellospring-doc.cn

app.hello=Hello From Application!