我有一个名为application-dev.yml
的属性文件,其内容如下:
spring.profiles: dev
config.some.value:
- ELEMENT1
- ELEMENT2
还有另一个内容为application-staging.yml
的应用程序:
spring.profiles: staging
config.some.value:
- ELEMENT1
- ELEMENT2
- ELEMENT3
所以我基本上不知道列表的大小。当我在主要的application.yml
中像这样引用这个列表:
some.value: ${config.some.value}
我收到了 Failed to convert property value of type 'java.lang.String' to required type 'java.util.List' for property 'value'
的错误。应该如何正确引用它?
default
的application.yml
中包含staging
和dev
吗? - Ryuzaki L