Spring Boot带连字符的配置文件名称工作不一致

问题描述 投票:3回答:1

从云配置服务器提供服务的Spring Boot配置文件似乎支持特定于应用程序的属性文件{application}-{profile} .properties的连字符,但不支持全局属性文件application- {profile} .properties的连字符

例如,在名为“ testapp”的应用程序中:

如果配置文件名称是“ testprofile”,则将属性放置在application-testprofile.properties和testapp-testprofile.properties中将起作用。已使用端点/testapp-testprofile.properties验证

但是,如果配置文件名称是“ test-profile”,则testapp-test-profile.properties中的属性将起作用,但是application-test-profile.properties中的属性将无法起作用。使用端点/testapp-test-profile.properties进行了验证

我是否缺少某些东西,或者这是Spring云配置服务器处理属性文件的方式中的(非常小的)错误/不一致?

使用Spring Boot 1.5.0.RC1

spring-boot spring-cloud-config
1个回答
0
投票

这与this issue有关,此日期至今仍开放。显然,连字符在Spring Cloud Config Server HTTP服务中具有特殊含义,并且没有办法对其进行转义。就像其他人所做的那样,我最终没有在个人资料中使用连字符,这有点令人讨厌。

© www.soinside.com 2019 - 2024. All rights reserved.