- 最近在搞springcloud-config配置中心,windows中的git出了点小毛病,本地的global配置文件一直处于失效状态,小乌龟拉代码也不行,但是git bash 黑窗口使用git clone命令是可以的,但还是需要输入账号密码,查看了springcloud官方文档,可以指定git路径为本地路径
- 文档如下:
-
application.properties. server.port: 8888 spring.cloud.config.server.git.uri: file://${user.home}/config-repo where ${user.home}/config-repo is a git repository containing YAML and properties files. [Note] in Windows you need an extra "/" in the file URL if it is absolute with a drive prefix, e.g. file:///${user.home}/config-repo.
关于怎么需要什么jar包依赖,随便找个帖子都有这就不说了,主要看这段
-
spring.cloud.config.server.git.uri: file://${user.home}/config-repo
配置后通过请求ip:port
-
/{application}/{profile}[/{label}] /{application}-{profile}.yml /{label}/{application}-{profile}.yml /{application}-{profile}.properties /{label}/{application}-{profile}.properties
案例:localhost:8081/master/test
转载于:https://my.oschina.net/xpx/blog/1933676