title: Add properties file on classpath
body: <p>I am building a Spring standalone application which is based on Spring Boot. I want this application to read its properties from a property file which is outside of jar file in a separate directory. The structure of the built application looks like this</p>
  
  <pre><code>testApplication
  ├── test-1.0-SNAPSHOT.jar
  ├── lib
  │   └── &lt;dependencies are here&gt;
  └── conf
      └── application.properties
  </code></pre>
  
  <p>I want to load the application.properties file on classpath, so I am able to read in my application. Is it possible? Because when I run my jar file like this (on Windows):</p>
  
  <pre><code>java -cp "./*;lib/*;conf/*" com.myapp.Test
  </code></pre>
  
  <p>I get following exeption:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.myapp.Test]; nested exception is java.io.FileNotFoundException: class path resource [application.properties] cannot be opened because it does not exist
      at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:180)
  ...
  Caused by: java.io.FileNotFoundException: class path resource [application.properties] cannot be opened because it does not exist       
      at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:172)
  </code></pre>
  
  <p>I try to read the file from application by this Class annotation:</p>
  
  <pre><code>@PropertySource("classpath:application.properties")
  </code></pre>
  
  <p>Java documentation does not mention, that a non-jar files can be loaded on classpath, but if this application.properties is in the jar file test-1.0-SNAPSHOT.jar, then it can be accessed by this way.</p>
  
  <p>Is it possible to put external non-jar file on classpath? I know I don't necessarily have the file on classpath, I can access it by different ways but still I am curious if it is possible.</p>