Closed
Description
When using nested classes in @ConfigurationProperties
annotated classes, it's normally possible to override that value by passing a system property.
Now with 3.5.0-RC1 it does not work anymore.
System properties for the non-nested properties are being picked up normally, the issue seems to be only with nested properties.
@Getter
@Setter
@ConfigurationProperties(prefix="demo.greeting")
public class GreetingProperties {
private String message = "Default Message";
private GreetingDetailsProperties details = new GreetingDetailsProperties();
@Setter
@Getter
static class GreetingDetailsProperties {
String salutation = "Default Salutation";
}
}
When the system property demo.greeting.details.salutation
is passed with some custom value, it's not being picked up and the "salutation" will always be "Default Salutation".
A small and isolated reproduction case can be found in this repository:
https://github.com/coduinix/gh-45639-repro-configuration-properties-issue