title: Spring Boot - application.yml, read value from a file
body: <p>I have a property present in application.yml but the value of that property is present in another file. Over here <code>username</code> is present in file <code>/etc/app/db_username</code></p>
  <pre><code>database:
     url: localhost:14482
     username: /etc/app/db_username
     password: /etc/app/db_password
  </code></pre>
  <p>Is there a way I can have values of username and password from the file automatically instead of me reading the file.</p>
  <pre><code>@Value(&quot;${database.username}&quot;)
  String username; //Will give me /etc/app/db_username
  
  @Value(&quot;${database.password}&quot;)
  String password; //Will give me /etc/app/db_password
  </code></pre>