简体   繁体   English

spring cloud config server git for local file

[英]spring cloud config server git for local file

I want get the data from local file using spring cloud config server git. 我想使用spring cloud config server git从本地文件中获取数据。

I have tried with below Yaml config but it is not working. 我已尝试使用下面的Yaml配置,但它无法正常工作。

server: port: 8888 服务器:端口:8888

spring: cloud: config: server: git: uri: file:///C:/spring-boot-ws/demo-springcloud-m2-configserver-git/pluralsight-spring-cloudconfig-wa-tolls-master/ spring:cloud:config:server:git:uri:file:/// C:/ spring-boot-ws / demo-springcloud-m2-configserver-git / pluralsight-spring-cloudconfig-wa-tolls-master /

My folder Structure is like 我的文件夹结构就像

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

As its name suggest, using git means that you have to set the uri of the repository containing your configurations and not a local files. 顾名思义,使用git意味着您必须设置包含配置而不是本地文件的存储库的uri。 If you want to use local files you should configure your server like this: 如果要使用本地文件,则应按如下方式配置服务器:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM