我刚刚运行了jhipster注册表,它工作得很好。它正在从central-config文件夹中查找配置文件。我想重构位于central config文件夹本身的文件夹下的配置文件。这是我使用如下配置运行Spring Cloud Config服务器可以实现的功能:
spring:
cloud:
config:
server:
git:
default-label: develop
uri: file://${user.home}/config-repo
search-paths: employee-service, enterprise-service我怎样才能在jhipster registry中用‘复合的东西’来实现这样的行为呢?对于信息,这是jhipster注册表中的bootstrap.yml文件:
# ===================================================================
# Spring Cloud Config bootstrap configuration for the "dev" profile
# In prod profile, properties will be overwriten by the ones defined in bootstrap-prod.yml
# ===================================================================
spring:
application:
name: jhipster-registry
profiles:
active: dev
include: composite
cloud:
config:
server:
bootstrap: true
composite:
- type: native
search-locations: file:./central-config
#search-locations: file://${user.home}/Acensi/isupplier/config-repo
prefix: /config
fail-fast: true
# name of the config server's property source (file.yml) that we want to use
name: jhipster-registry
profile: dev # profile(s) of the property source
label: master # toggle to switch to a different version of the configuration as stored in git
# it can be set to any label, branch or commit of the config source git repository
info:
project:
version: #project.version#
# uncomment to enable encryption features
#encrypt:
# key: my-secret-encryption-key-to-change-in-production发布于 2019-05-09 23:43:47
我也有同样的问题。我在application.yml文件中添加了以下内容:
spring:
cloud:
config:
server:
bootstrap: true
composite:
- type: native
search-locations: file:./central-config/myFolder你们已经很接近了,希望能有所帮助。
发布于 2019-05-31 03:02:50
我正在将现有的较旧的JHipster注册表升级到5.0.1。我也在使用git repo。上述配置的问题是,对于git存储库,该属性的名称不是search-locations,而是search-paths。为了让通过环境变量SPRING_CLOUD_CONFIG_SERVER_GIT_SEARCH-PATHS指定了搜索路径的所有内容都像以前一样工作,我在prod引导程序中使用了以下配置。
bootstrap-prod.yml:
spring:
cloud:
config:
server:
bootstrap: true
composite:
- type: git
uri: git@bitbucket.org:whatever/repo
search-paths: ${spring.cloud.config.server.git.search-paths}
ignore-local-ssh-settings: true
private-key: |
-----BEGIN RSA PRIVATE KEY-----https://stackoverflow.com/questions/55712277
复制相似问题