title: Spring not able to find classpath resource with @PropertySource
body: <p>I am using <code>@PropertySource</code> in my datasource configuration file to get property files located on classpath. Below is my project structure.</p>
  
  <p><a href="https://i.stack.imgur.com/kX6WP.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/kX6WP.jpg" alt="enter image description here"></a></p>
  
  <p>I believe I can do it in two ways:</p>
  
  <ol>
  <li>By creating a package in <code>src</code> folder and add them there. As <code>src</code> folder is already included in the classpath in eclipse, following should work. </li>
  </ol>
  
  <blockquote>
    <p>@PropertySources({
            @PropertySource("classpath: com/spring/property/general.properties"),
            @PropertySource("classpath: com/spring/property/hibernate.properties")
    })</p>
  </blockquote>
  
  <ol start="2">
  <li>Second way is to create a <code>resources</code> folder and add it to the classpath and following should work</li>
  </ol>
  
  <blockquote>
    <p>@PropertySources({
            @PropertySource("classpath: general.properties"),
            @PropertySource("classpath: hibernate.properties")
    })</p>
  </blockquote>
  
  <p>In my case neither of the two is working. Being an intermediate java developer this still confuses me. Can anybody guide me in the right direction. And also how we can configure classpath resources for Spring in a production environment.</p>
  
  <p><strong>EDIT</strong>:
  I have changed my project structure to include properties file in <code>src/java/resources</code> and I can see the <code>resources</code> folder in build path. Still <code>.properties</code> are not found by spring.</p>
  
  <p><a href="https://i.stack.imgur.com/5d39e.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/5d39e.jpg" alt="enter image description here"></a></p>