Reputation: 339
I have a spring boot jar(name : myjar) located in the directory structure
D:/hello/myjar
The fat jar contains profile specific application.properties in src/main/resources for e.g. application-local.properties
I want to override the attributes defined in the application-local.properties inside the jar with application-local.properties outside the jar
Hence I created application-local.properties and kept it in the same folder as jar i.e. D:/hello
However when I run my jar using the command :
java -jar -Dspring.profiles.active=local D:/hello/myjar.jar
it still picks the properties which is inside the jar. Am I missing something ?
Upvotes: 1
Views: 1231
Reputation: 1891
Try this use -D before -jar
java -Dspring.profiles.active=local -jar D:/hello/myjar.jar
let's see https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config
Upvotes: 3
Reputation: 339
I think it was more of point that from where I was running my jar from the command prompt.
If I run the jar from the folder where my jar is present, it does picks the profile specific files present outside the jar.
Upvotes: 0