spring.config.location不适用于弹簧护套2.0.0 M6

spring.config.location不适用于弹簧护套2.0.0 M6,spring,spring-boot,kotlin,Spring,Spring Boot,Kotlin,我正在将我的一个micro服务迁移到Spring Boot 2.0.0.M6,在使用命令行上的--Spring.config.location=选项时出现错误。错误如下: Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'property' in value "${property}" at org.springframework.util.PropertyPlaceholderHelper

我正在将我的一个micro服务迁移到Spring Boot 2.0.0.M6,在使用命令行上的
--Spring.config.location=
选项时出现错误。错误如下:

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'property' in value "${property}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:172) ~[spring-core-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) ~[spring-core-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237) ~[spring-core-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211) ~[spring-core-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175) ~[spring-context-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:834) ~[spring-beans-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1081) ~[spring-beans-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1060) ~[spring-beans-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:578) ~[spring-beans-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:91) ~[spring-beans-5.0.1.RELEASE.jar:5.0.1.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:367) ~[spring-beans-5.0.1.RELEASE.jar:5.0.1.RELEASE]
... 50 common frames omitted
如果我不使用自定义属性文件,那么一切都会按预期工作,或者使用发布版本。我使用以下命令启动应用程序:

java-jar-application.jar--spring.config.location=app.properties

更新 我注意到,使用此选项时,Spring会完全替换项目中的默认application.properties,而以前的Spring版本只会覆盖参数文件中的属性。这是虫子吗

更新2
从团队那里得到了一个警告,显然这是故意的行为。现在试着知道是否有办法使用旧版本的行为。

您的项目结构将非常有帮助。但除此之外

Spring文档给出了如何使用该标志的示例:

    --spring.config.location=classpath:/default.properties

尝试根据类路径解析应用程序属性。

正如Spring团队所述,使用
Spring.config.location
中的旧行为的正确方法是使用新的
Spring.config.additional location

我使用默认结构(src/main/resources/application.yml),但这不是问题所在。我在SpringBoot的发布版本中使用了ok标志,但现在里程碑版本替换了该文件。刚收到团队的回复:在回复中,Andy给了你一个链接,指向使用旧行为的方法:
spring.config.additional location
而不是
spring.config.location
@EvgeniDimitrov是的,我以前尝试过,但没有成功。一定是打错了什么东西或其他东西,因为当我再次尝试时,它起作用了。请提供示例以供参考,以下是和中的相关项目。