I have a spring boot web app but I want to load the application.properties
file in another path because it has private information about database connection string.
Here are things what I did:
- Remove the
application.properties
file in the default path like this:
src
main
resources
application.properties
- I tried a kind of command line (I use gradle not maven):
> gradle clean assemble
> java -jar -Dspring.config.location=<Insert the path here> build/libs/<jar-file>
As usual. The code would run with the configuration of application.properties
file as my desire. But many changes later seems doesn't save and still run old code before it has changed. How to solve it?