Spring云配置服务器&x2B;比特桶
我正在尝试使用BitBucket私有存储库设置SpringCloud的配置服务器,但没有任何运气。无论我使用什么配置,在尝试加载配置时,我似乎总是返回404 我还尝试在Spring云配置服务器&x2B;比特桶,spring,git,spring-cloud,Spring,Git,Spring Cloud,我正在尝试使用BitBucket私有存储库设置SpringCloud的配置服务器,但没有任何运气。无论我使用什么配置,在尝试加载配置时,我似乎总是返回404 我还尝试在JGitEnvironmentRepository中设置断点,但似乎从未在afterPropertiesSet之外调用它。如果我在调试时手动触发findOne(应用程序、配置文件、标签),我会得到一个错误,不允许分支名称。如果我为label属性指定“master”,那么我会得到可怕的Ref master无法解决的错误 应用程序加载
JGitEnvironmentRepository
中设置断点,但似乎从未在afterPropertiesSet
之外调用它。如果我在调试时手动触发findOne(应用程序、配置文件、标签)
,我会得到一个错误,不允许分支名称
。如果我为label
属性指定“master”,那么我会得到可怕的Ref master无法解决的错误
应用程序加载正常,但没有结果。从我阅读的所有文档来看,这似乎应该是开箱即用的。任何帮助都将不胜感激
bootstrap.yml
server:
port: 8888
spring:
application:
name: config-service
cloud:
bus.amqp.enabled: false
config:
enabled: false
failFast: true
server:
prefix: /configs
git :
uri: https://bitbucket.org/[team]/[repo].git
username: [user]
password: [pass]
回购文件
- demo.app.yml
尝试的URL
您需要将配置文件名称添加到url。默认配置文件为“默认”
这仅适用于1.0.0.RELEASE版本,但对于1.0.1.RELEASE版本,我在Windows上发现了一个问题(文件分隔符存在问题,因此配置服务器在本地克隆存储库中找不到YAML文件)。也许这就是相关的问题:
如果您仍然有任何问题,可以参考下面的客户端配置。我已成功配置bitbucket存储库
Spring Boot Version: 1.4.1.RELEASE
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Camden.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
-----------------------------------------------------------------------
bootstrap.yml
spring:
application:
name: client-config
cloud:
config:
failFast: true
label: master
profile: default
username: <username>
password: <password>
server:
bootstrap: true
uri: http://localhost:8888
Spring引导版本:1.4.1.0版本
org.springframework.cloud
spring云依赖关系
卡姆登释放
聚甲醛
进口
-----------------------------------------------------------------------
bootstrap.yml
春天:
应用程序:
名称:客户端配置
云:
配置:
失败:真的
标签:master
配置文件:默认值
用户名:
密码:
服务器:
引导:正确
uri:http://localhost:8888
@David Welch,是的,正确的url是http://localhost:8888/configs/demo.app/default
。我能够让bitbucket私人回购顺利运行。api是/
或//
。您还可以显示服务器配置吗。此用户名和密码用于bitbucket&它们是否应位于客户端或配置服务器内。。如果您能在bitbucket中显示目录结构,这也会很有帮助。我可以从github获得配置,但不能从bitbucket获得配置