title: Running jar with -Dloader.path= works, but not application.properties loader.path
body: <p>I have an external properties file under /config/application.properties which I retrieve properties from. When I run my jar, it is able to pick up certain properties from it, (e.g. server.port=8083)</p>
  
  <p>This is the structure of my files/folders:</p>
  
  <pre><code>ProjectFolder
   |
   +-- mytool.jar
   |    
   +-- config
   |  |  
   |  +-- application.properties
   |    
   +-- lib
   |  |  
   |  +-- externalJar.jar
  </code></pre>
  
  <p>Now, the problem is that I need the property "loader.path" from the external properties file, all other properties are being loaded correctly except for loader.path when I run the jar with:</p>
  
  <pre><code>java -jar mytool.jar
  </code></pre>
  
  <p>Inside the external application.properties contains:</p>
  
  <pre><code>spring.servlet.multipart.enabled=false
  server.port = 8083
  logging.file = /someplace/
  loader.path=lib
  </code></pre>
  
  <p>Since it is not loading the externalJar.jar, I encounter classNotFoundExceptions.</p>
  
  <p>However, what's strange is that when I start the app with:</p>
  
  <pre><code>java -Dloader.path=lib -jar mytool.jar
  </code></pre>
  
  <p>Everything works as expected.</p>
  
  <p>Am I missing something with the application.properties file?
  I have tried using the full path: </p>
  
  <pre><code>loader.path=/home/me/ProjectFolder/lib
  </code></pre>
  
  <p>but that didn't work either. 
  I am confident that the application.properties is being read because the server.port number showing up on boot is the one I specifically specified.</p>
  
  <p>I've changed the project to use the PropertiesLauncher in Maven.
  MANIFEST.MF</p>
  
  <pre><code>Manifest-Version: 1.0
  Implementation-Title: mytool
  Implementation-Version: 0.0.1-SNAPSHOT
  Built-By: giraffepoo
  Implementation-Vendor-Id: com.sap
  Spring-Boot-Version: 2.1.3.RELEASE
  Main-Class: org.springframework.boot.loader.PropertiesLauncher
  Start-Class: com.sap.mytool
  Spring-Boot-Classes: BOOT-INF/classes/
  Spring-Boot-Lib: BOOT-INF/lib/
  Created-By: Apache Maven 3.3.9
  Build-Jdk: 1.8.0_201
  Implementation-URL: https://projects.spring.io/spring-boot/#/spring-bo
   ot-starter-parent/mytool
  </code></pre>
  
  <p>If someone could point me in the right direction, your help is greatly appreciated. Thanks!</p>
  
  <p>Note:
  Not sure if related, but the externalJar.jar is utilized immediately when the application starts up in the overridden method: contextInitialized</p>