我刚刚运行了 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