title: How to pass empty string as a command line property to Spring?
body: <p>FYI: I am using Intellij's 'Run/Debug Configurations' tool.</p>
  
  <p>I would like to pass an empty string as a property to my app via the command line:</p>
  
  <pre><code>--spring.ldap.username=
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>--spring.ldap.username= # results in parse error
  --spring.ldap.username=''
  --spring.ldap.username="" # results in parse error
  --spring.ldap.username=\"\"
  </code></pre>
  
  <p>The attempts that actually parsed successfully yielded incorrect values, as demonstrated when I try to print the 'empty' Strings:</p>
  
  <pre><code>System.out.println(environment.getProperty("spring.ldap.username"));
  
  // returns:
  // ''
  // ""
  </code></pre>
  
  <p>Setting the same property to an empty string in the application.properties file works perfectly:</p>
  
  <pre><code>spring.ldap.username=
  </code></pre>
  
  <p>The same print statement:</p>
  
  <pre><code>// returns:
  //
  // ^^ totally empty string
  </code></pre>
  
  <p>Is there a trick I am missing?</p>