I have a Spring Boot application using Google Pub Sub API. I need to inject Google credentials and other properties using file credentials.json
. I put the file
If you use the classpath
prefix then Spring will look for the file on your classapth.
If you put the file in src/main/resources
then Maven will, by default, copy it to the root of your classpath and it will then be addressable as follows:
spring.cloud.gcp.credentials.location=classpath:credentials.json
This should hold true whether ...
src/main/resources
to the root of your classpath - typically target/classes
src/main/resources
to the root of your JAR