Spring cloud配置组织文件夹中的文件

Ami*_*leb 7 java git spring spring-cloud-config

我正在尝试在我的Git仓库中的文件夹中组织一组配置文件.我在Spring Cloud Docs中读到了这可以这样做:

HTTP服务具有以下形式的资源:

/{application}/{profile}[/{label}] 

/{application}-{profile}.yml

/{label}/{application}-{profile}.yml

/{application}-{profile}.properties

/{label}/{application}-{profile}.properties
Run Code Online (Sandbox Code Playgroud)

所以我按照第一个模式创建了我的配置结构:

app1/uat/application.yml

但Config服务找不到它.它并没有真正说明配置文件文件夹中的文件应该是什么样子,并且在任何地方我都看到了第2和第4个模式的示例.

第一种模式真的有效吗?谁能举个例子?

Ami*_*leb 17

解决了,只需添加:

spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/your-repo
          searchPaths: '{application}/{profile}'
Run Code Online (Sandbox Code Playgroud)

那就行了