title: FileNotFoundException while accessing a file in bootstrap.yml, even the file is present under /resources?
body: <p>I created a Spring boot project's fat jar using <code>mvn package</code>. Inside the <code>/resources/bootstrap.yml</code> I am trying to access a file which is also under <code>/resources</code>.</p>
  <p><strong><code>location: classpath:secret.json</code>.</strong></p>
  <p><code>bootstrap.yml</code> and <code>secret.json</code> both are inside <code>/resources</code> package.</p>
  <p>But I am getting <code>java.io.FileNotFoundException: class path resource [secret.json] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/Users/test/Downloads/Demo/demo-api/target/demo-api-0.0.1-SNAPSHOT.jar!/BOOT-INF/classes!/secret.json</code></p>
  <p>The same is working in IDE. What could be the wrong?</p>
  <p>bootstrap.yml</p>
  <pre><code>spring:
    cloud:
      gcp:
        project-id: &lt;something&gt;
        sql:
          instance-connection-name: &lt;something&gt;
          database-name: &lt;something&gt;
        credentials:
          location: classpath:secret.json
        secretmanager:
          enabled: true
          project-id: &lt;something&gt;
          credentials:
            location: classpath:secret.json
  </code></pre>
  <p>I can see the <code>secret.json</code> under classpath in the decompiled jar.
  <a href="https://i.stack.imgur.com/7SGHv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7SGHv.png" alt="decompiled jar" /></a></p>
  <p>The project structure;
  <a href="https://i.stack.imgur.com/mJ4ql.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mJ4ql.png" alt="project" /></a></p>
  <p>Closing the question. It's an limitation by spring-cloud.<br />
  <a href="https://stackoverflow.com/questions/50981257/spring-boot-project-jar-file-not-reading-file-placed-on-classpath/50990669#50990669">Spring Boot Project Jar file not reading File placed on classpath</a>.<br />
  <a href="https://github.com/spring-cloud/spring-cloud-gcp/issues/339" rel="nofollow noreferrer">https://github.com/spring-cloud/spring-cloud-gcp/issues/339</a></p>