I'm trying to get my spring boot project to use properties defined outside of project. I have tried the steps described in docs but I'm unable to get it to work.
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html
.
+- folder
+- properties
+- application.properties
+- myproject
+- src
I'm using this for VM options: -Dspring.config.location=file:../properties/
but it's not working. I tried multiple values for spring.config.location
with no success (I suppose the issue is from here).
Let's say I've an app which connects to Postgresql Database. I've my database connection details outside of my project which is in some centralized version control system. I'm using
bootstrap.properties
file in my app. I've configured inbootstrap.properties
to fetch my database connection details at app startup. For Example,I'm passing config keys as values in bootstrap.properties. During app runtime, it will fetch the corresponding values based on keys.