0

I have the following @ConfigurationProperties property holder:

@ConfigurationProperties(prefix = "custom.service")
public class CustomServicePropertyHolder {

    private String name;
}

and my application.properties looks like this:

custom.service.name=${remote.service.name}
custom.service.....=...
custom.service.....=...

remove.service.name is an environment variable received in the runtime.

However, when remote.service.name was not provided, the value of the EtlConfigurationHolder.name is a string "${remote.service.name}".

How to make the property to return null instead of this placeholder string ?

Tomas Lukac
  • 1,923
  • 2
  • 19
  • 37

1 Answers1

1

I also encountered such a problem ... And it has been present for a long time

I found only one place where at least some solution is attached

https://davidagood.com/spring-boot-fail-on-missing-env-vars/

LeshaRB
  • 1,345
  • 2
  • 23
  • 44