原先的项目中用的是composite模式,同时使用native和svn,现改为只使用native,将配置改为:
spring:
profiles:
#原先
#active: dev,composite
#改为
active: dev,native
spring:
application:
name: admin
cloud:
config:
profile: dev
server:
bootstrap: true
#改为
native:
search-locations: C:/code/config/kv-config
#原先
#composite:
#- type: native
# search-locations: C:/code/config/kv-config
# - type: svn
# uri: http://1.1.1.1
# username: user
# password: pwd
# default-label: ''
# search-paths: '{application}'
# basedir: /config-server-repostory/kv-config
然后就出现问题了,原先可以通过"http://ip:port/admin/dev"访问到kv-config目录下admin文件夹的默认(application)-dev.yml文件,但改为native模式后就不行了,只能访问到这两种格式的文件
/{application}-{profile}.yml
/{application}-{profile}.prope