With Spring Boot, you can override application properties using command line arguments like so:
java -jar my-boot.jar --my.property.name=value
This, however, fails when you try to pass an empty value:
java -jar my-boot.jar --my.property.name=
java.lang.IllegalArgumentException: Invalid argument syntax: --my.property.name=
at org.springframework.core.env.SimpleCommandLineArgsParser.parse(SimpleCommandLineArgsParser.java:75)
at org.springframework.core.env.SimpleCommandLinePropertySource.<init>(SimpleCommandLinePropertySource.java:90)
Since an empty string is a legal value for an application property, there seems to be no good reason to reject command line arguments with an empty value.
A real-world example is Kafka's ssl.endpoint.identification.algorithm which has to be set to an empty string to disable host name verification.
With Spring Boot, you can override application properties using command line arguments like so:
This, however, fails when you try to pass an empty value:
Since an empty string is a legal value for an application property, there seems to be no good reason to reject command line arguments with an empty value.
A real-world example is Kafka's
ssl.endpoint.identification.algorithmwhich has to be set to an empty string to disable host name verification.