title: Access configuration file mentioned in spring boot application.properties after creating the .jar for App engine deployment
body: <p>I am facing big trouble in deploying a spring boot application in GCP AppEngine with cloud Postgres as a database. Earlier I was using tcp connection jdbc with IP whitelisting to access the database, which worked fine during testing but after deploying into Appengine it didn't warmed up due to <code>sslsocket timed out</code>. So after a bit of digging, I found for standard appengine runtime to connect a cloud Postgres I have to use postgres socket factory</p>
  <pre class="lang-xml prettyprint-override"><code>        &lt;dependency&gt;
              &lt;groupId&gt;com.google.cloud.sql&lt;/groupId&gt;
              &lt;artifactId&gt;postgres-socket-factory&lt;/artifactId&gt;
              &lt;version&gt;1.2.2&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  <p>with
  <code>spring.datasource.url=jdbc:postgresql:///{REDACT}?cloudSqlInstance={REDACT}&amp;socketFactory=com.google.cloud.sql.postgres.SocketFactory&amp;user={REDACT}&amp;password={REDACT} </code> in application.properties.</p>
  <p>But GCP needs to verify the connection from the key generated from the service account with specific privileges which has been added to the application.properties.
  <code>spring.cloud.gcp.credentials.location=classpath:gcloud.json </code></p>
  <p>But in java the built jar file can't access the json, nor the deployed appengine instance.
  Here's the error</p>
  <p>[Screenshot error in App engine][1]</p>
  <p>app.yaml</p>
  <pre class="lang-yaml prettyprint-override"><code>runtime: java11
  </code></pre>
  <p>pom.xml</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;dependency&gt;
              &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
              &lt;artifactId&gt;spring-cloud-gcp-starter-sql-postgresql&lt;/artifactId&gt;
              &lt;version&gt;1.2.7.RELEASE&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;42.2.19&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.google.cloud.sql&lt;/groupId&gt;
              &lt;artifactId&gt;postgres-socket-factory&lt;/artifactId&gt;
              &lt;version&gt;1.2.2&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  <p>Any reply would be of great help. Thanks
  [1]: <a href="https://i.stack.imgur.com/gEV2r.png" rel="nofollow noreferrer">https://i.stack.imgur.com/gEV2r.png</a></p>