【问题标题】:spring cloud config server git for local file用于本地文件的 spring 云配置服务器 git
【发布时间】:2019-10-26 13:44:18
【问题描述】:

我想使用 spring cloud config server git 从本地文件中获取数据。

我尝试过使用以下 Yaml 配置,但它不起作用。

服务器: 端口:8888

弹簧: 云: 配置: 服务器: 混帐: uri: file:///C:/spring-boot-ws/demo-springcloud-m2-configserver-git/pluralsight-spring-cloudconfig-wa-tolls-master/

我的文件夹结构是这样的

C:>spring-boot-ws>demo-springcloud-m2-configserver-git>pluralsight-spring-cloudconfig-wa-tolls-master>station1>s1rates.properties

【问题讨论】:

    标签: spring git server cloud config


    【解决方案1】:

    顾名思义,使用git 意味着您必须设置包含您的配置的存储库的uri,而不是本地文件。如果你想使用本地文件,你应该像这样配置你的服务器:

    spring:
       profiles:
         active: native
       cloud:
          config:
            server:
              native:
                searchLocations: file:///...
    

    【讨论】:

      猜你喜欢
      • 2018-05-15
      • 1970-01-01
      • 2020-01-04
      • 2020-11-24
      • 2020-02-06
      • 2021-03-29
      • 1970-01-01
      • 1970-01-01
      • 2019-07-21
      相关资源
      最近更新 更多