Capeta Capeta - 1 year ago 142
Java Question

Spring Boot Application java -jar --property override not working

I've written a Spring Boot Application. I'm running the jar, while running the jar I'm overriding the property file keys for e.g:

java -jar example.jar
, but the key is not overriding. What could be the reason for this?

Answer Source

For command line arguments to override properties, you need the arguments pass into your application's main method into

Your main method should look something like this:

public static void main(String[] args) throws Exception {, args);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download