Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the values of application.yaml at runtime?

How do I change the values of application.yaml at runtime e.g I have a server address property that I would like to change at runtime

server: address: 192.168.1.100

like image 245
Daniel Naves Avatar asked Oct 21 '25 03:10

Daniel Naves


1 Answers

I assume this is a spring application, if so you can use the jvm arguments (-D) to override the values from application.yaml file. e.g application.yaml

server:
  address: 192.168.0.1

cmd line

java -jar -Dserver.address=10.10.0.1
like image 136
Oga Technology Avatar answered Oct 24 '25 14:10

Oga Technology