spring-cloud-commons icon indicating copy to clipboard operation
spring-cloud-commons copied to clipboard

spring.profiles.include must be a comma separated value in contrast to to non-cloud usage

Open elmuerte opened this issue 1 year ago • 0 comments

Describe the bug According to the documentation for spring.profiles.include the value for spring.profiles.include is a list.

spring.profiles.include[0]=common
spring.profiles.include[1]=local

But using this in a configuration file provided via cloud config it does not work. Instead it expects the value to be a comma separated string value:

spring.profiles.include=common,local

The offending code:

https://github.com/spring-cloud/spring-cloud-commons/blob/main/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/config/PropertySourceBootstrapConfiguration.java#L306-L317

In Spring Boot the configuration setting is processed as a string list:

https://github.com/spring-projects/spring-boot/blob/main/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataEnvironment.java#L291-L310

The difference in behavior is not documented anywhere.

elmuerte avatar Nov 08 '24 08:11 elmuerte