How to specify the GCP Credential Location in the application.properties file (for using the Pub/Sub in GCP)?
I am facing the below issue.
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'firestoreOptions' defined in class path resource [org/springframework/cloud/gcp/autoconfigure/firestore/GcpFirestoreAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.google.cloud.firestore.FirestoreOptions]: Factory method 'firestoreOptions' threw exception; nested exception is java.lang.RuntimeException: Failed to obtain credentials
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:657) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:485) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
Caused by: java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:134) ~[google-auth-library-oauth2-http-0.26.0.jar:na]
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:120) ~[google-auth-library-oauth2-http-0.26.0.jar:na]