This is a few months ago, but I'm going to answer it, because I just ran into this problem and found your question through Google, and Ivan commented on the run in my memory. Since he didn’t specify, and I’m not sure if you solved your problem (probably you are already), you will want to change:
public static void main(String[] args) { SpringApplication.run(Application.class); }
to
public static void main(String[] args) { SpringApplication.run(Application.class, args); }
It's simple. Arguments before this never went anywhere when they passed, thus not overriding the application.yml property. So just in case, if you did not understand this or someone stumbled upon this question, like me, this is what Ivan had in mind
Do you pass command line arguments when running SpringApplication.run(...) ?
source share