Java 如何定义子文件夹以查找jhipster注册表的配置文件
我刚刚运行了jhipster注册表,它工作正常。它正在从中央配置文件夹中查找配置文件。我想重构中央配置文件夹中文件夹下的配置文件。我可以通过如下配置运行Spring Cloud Config server实现这一点:Java 如何定义子文件夹以查找jhipster注册表的配置文件,java,spring-boot,jhipster,jhipster-registry,Java,Spring Boot,Jhipster,Jhipster Registry,我刚刚运行了jhipster注册表,它工作正常。它正在从中央配置文件夹中查找配置文件。我想重构中央配置文件夹中文件夹下的配置文件。我可以通过如下配置运行Spring Cloud Config server实现这一点: spring: cloud: config: server: git: default-label:
spring:
cloud:
config:
server:
git:
default-label: develop
uri: file://${user.home}/config-repo
search-paths: employee-service, enterprise-service
如何使用jhipster注册表中的“composite thing”实现这种行为。有关信息,请参阅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
我也有同样的问题。我在我的
应用程序.yml
文件中添加了以下内容:
spring:
cloud:
config:
server:
bootstrap: true
composite:
- type: native
search-locations: file:./central-config/myFolder
你非常接近,希望能有所帮助。我也有同样的问题。我在我的
应用程序.yml
文件中添加了以下内容:
spring:
cloud:
config:
server:
bootstrap: true
composite:
- type: native
search-locations: file:./central-config/myFolder
您非常接近,希望能有所帮助。我正在将现有的较旧JHipster注册表升级到5.0.1。我也在使用git回购。上述配置的问题在于,对于git repo,该属性未被称为
搜索位置
,而是搜索路径
。为了使所有的搜索路径都像以前一样通过环境变量SPRING\u CLOUD\u CONFIG\u SERVER\u GIT\u search-paths
指定,我在我的产品引导中使用了以下配置
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-----
我正在将现有的旧JHipster注册表升级到5.0.1。我也在使用git回购。上述配置的问题在于,对于git repo,该属性未被称为
搜索位置
,而是搜索路径
。为了使所有的搜索路径都像以前一样通过环境变量SPRING\u CLOUD\u CONFIG\u SERVER\u GIT\u search-paths
指定,我在我的产品引导中使用了以下配置
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-----