首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何定义子文件夹以查找jhipster注册表的配置文件

如何定义子文件夹以查找jhipster注册表的配置文件
EN

Stack Overflow用户
提问于 2019-04-16 23:59:01
回答 2查看 456关注 0票数 1

我刚刚运行了jhipster注册表,它工作得很好。它正在从central-config文件夹中查找配置文件。我想重构位于central config文件夹本身的文件夹下的配置文件。这是我使用如下配置运行Spring Cloud Config服务器可以实现的功能:

代码语言:javascript
复制
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文件:

代码语言:javascript
复制
# ===================================================================
# 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
EN

回答 2

Stack Overflow用户

发布于 2019-05-09 23:43:47

我也有同样的问题。我在application.yml文件中添加了以下内容:

代码语言:javascript
复制
spring:
  cloud:
    config:
      server:
        bootstrap: true
        composite:
          - type: native
            search-locations: file:./central-config/myFolder

你们已经很接近了,希望能有所帮助。

票数 0
EN

Stack Overflow用户

发布于 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:

代码语言:javascript
复制
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-----
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55712277

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档