title: ClassPathResource does not get the classpath
body: <p>In my application, I would like to use a resource that exist in a folder <code>media/src/main/resources/testMediaExif</code></p>
  
  <p>To get that path, I used this piece of code, located in <code>media/src/main/java/com/project/MyClass.java</code>:  </p>
  
  <pre><code>ClassPathResource resource = new ClassPathResource("classpath:testMediaExif");
  File file = resource.getFile();
  String absolutePath = file.getAbsolutePath();
  </code></pre>
  
  <p>The error shown is:</p>
  
  <pre><code>java.io.FileNotFoundException: class path resource [classpath:testMediaExif] cannot be resolved to URL because it does not exist
  </code></pre>
  
  <p>If I change that code: </p>
  
  <pre><code>ClassPathResource resource = new ClassPathResource("testMediaExif");
  </code></pre>
  
  <p>The variable absolutePath takes this value: </p>
  
  <pre><code>/Users/blanca/desarrollo/media/target/test-classes/testMediaExif
  </code></pre>
  
  <p>Why does it point to the target path? How could I change it?</p>