I wanted to change the spring.config.additional-location for my gradle springboot app to run local. There's a properties file in my C:/demo_class_path
and it's outside the jar. I was trying to access those properties in code.
the command java -jar demo-application.jar spring.config.additional-location=file:C:/demo_class_path
to run the jar wtth arguments works and I'll be able get the resource I need. But I was trying to add the arguement in bootRun task and it wasn't successful.
I tried the code below :
bootRun {
systemProperties = [
'spring.config.additional-location' : "file:C:/demo_class_path",
'server.port' : 8090
]
}
or
bootRun {
jvmArgs = [
"-Dspring.config.additional-location=file:C:/demo_class_path/",
"-Dserver.port=8090"
]
}
With the code above I will be able to change the port to 8090, but my files can't be picken up from the path anymore. I also tried to add spring.config.additional-location=file:C:/demo_class _path to application.properties and that didn't work either. I was wondering if the syntax for the location is wrong. In that case, why would the java command work?