0
我正在开发spring引导服务。SPring引导服务之间的共享配置(在git上)
所以我们可以说我有3个服务A,B,C,每个都有dev和prod配置文件。现在我将这些服务的配置保存在GIT中,并使用配置服务器来获取配置。
因此,当我在产品模式下运行A服务时,配置文件A-prod.properties正在被使用。
现在我想保留一些通用的配置,它将被所有3个服务使用common-prod.properties。我应该怎么做?
我已经试过这样:
配置服务器:
spring:
cloud:
config:
server:
git:
uri: http://gitPaath/Configs.git
username: <username>
password: <pass>
cloneOnStart: true
searchPaths: "{common}"
我的属性文件在Git的回购顺序如下:
- A-prod.properties
- A-dev.properties
- B-prod.properties
- A-dev.properties
- C-prod.properties
- C-dev.properties
- common
- common-prod.propeties
- common-dev.properties
您是否能够解决此问题,如果是,请分享解决方案 – Ratheesh
该解决方案是以下关于accacent的解答。简单地创建应用程序 - .properties文件 –