title: Spring Boot "Could not resolve placeholder"
body: <p>I am working on a Spring Boot Tomcat application using Maven. When I run it in my IDE (IntelliJ IDEA) it works fine. However when I run it normally</p>
  
  <pre><code>java -jar myjar.jar
  </code></pre>
  
  <p>I get an exception</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: 
  Could not resolve placeholder 'sysm.client.api.path' in value "${sysm.client.api.path}"
  </code></pre>
  
  <p>I also tried using JarLoader and PropertiesLauncher with no better luck.</p>
  
  <p>I do have that property sysm.client.api.path defined in my application.properties, but for good measure I also added it to the command line as a -D parameter -Dsysm.client.api.path=my-path.</p>
  
  <p>The Value injection itself is happening in some dependency code, otherwise I would simply hard code that value.</p>
  
  <p>One note: IntelliJ is not running it as a -jar; rather it declares all of the libraries in a vast -classpath command line argument and then uses my @SpringBootApplication class as the executable class, completely not in keeping with the Spring Boot spirit!</p>
  
  <p>I am wondering why this module seems to be getting its properties before the application.properties are loaded, and if there is any way to resequence that so that it works</p>
  
  <p>UPDATE: I double checked the jar and the application properties are there under BOOT-INF/classes/application.properties. But for some reason the application is not seeing that in the jar. When I copy those to the launch dir, it works fine. Not sure why these are not being picked up from the jar as expected?</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;commy-group&lt;/groupId&gt;
  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
  &lt;version&gt;2.0.1-SNAPSHOT&lt;/version&gt;
  
  &lt;name&gt;${project.artifactId}&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.5.10.RELEASE&lt;/version&gt;
  &lt;/parent&gt;
  
  &lt;properties&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;distribution.root&gt;discovery-service-${project.version}&lt;/distribution.root&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;ansible.group&gt;npc&lt;/ansible.group&gt;
      &lt;ansible.name&gt;${project.artifactId}&lt;/ansible.name&gt;
      &lt;ansible.deploy&gt;2018-1&lt;/ansible.deploy&gt;
  &lt;/properties&gt;
  
  &lt;scm&gt;
      &lt;url&gt;..&lt;/url&gt;
      &lt;connection&gt;..&lt;/connection&gt;
      &lt;developerConnection&gt;..&lt;/developerConnection&gt;
  &lt;/scm&gt;
  
  &lt;distributionManagement&gt;
      ...
  &lt;/distributionManagement&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
          &lt;version&gt;4.1.5.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- ********************* SPRING ********************* --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-rest&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.springfox&lt;/groupId&gt;
          &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
          &lt;version&gt;2.6.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.springfox&lt;/groupId&gt;
          &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
          &lt;version&gt;2.6.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-ldap&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-actuator&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-hateoas&lt;/artifactId&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;junit&lt;/groupId&gt;
          &lt;artifactId&gt;junit&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;finalName&gt;${project.artifactId}&lt;/finalName&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;executable&gt;true&lt;/executable&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;buildnumber-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.4&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;phase&gt;validate&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;create&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;doCheck&gt;false&lt;/doCheck&gt;
                  &lt;doUpdate&gt;false&lt;/doUpdate&gt;
                  &lt;shortRevisionLength&gt;8&lt;/shortRevisionLength&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>