title: Spring Boot build to .jar and run Could not resolve placeholder
body: <p>I build my spring boot application to .jar file with:</p>
  
  <pre><code>./gradlew build
  </code></pre>
  
  <p>and when I want to run this app:</p>
  
  <pre><code>java -jar /build/libs/app.jar
  </code></pre>
  
  <p>I get error:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.data.mongodb.host' in string value "${spring.data.mongodb.host}"
  </code></pre>
  
  <p>etc.</p>
  
  <p>When I run this app in IntelliJ everything is ok. </p>
  
  <p>My application.properties</p>
  
  <pre><code>spring.data.mongodb.host=localhost
  spring.data.mongodb.port=27017
  spring.data.mongodb.username=newsAdminUser
  spring.data.mongodb.password=abc123
  spring.data.mongodb.database=newssystemservice
  
  server.compression.enabled=true
  server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain
  </code></pre>
  
  <p>What's the problem?</p>