Spring Boot – Passing multiple system properties in command line
For Spring Boot 2.2 +
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Dsystem_property1=value1 -Dsystem_property2=value2 -Dsystem_property3=value3"
For Spring Boot 1.5 and less
Use
-Drun.jvmArgumentsinstead of-Dspring-boot.run.jvmArgumentsfrom the above example
If there is a way to avoid system properties, it is the best way forward. For more information on this externalizing the properties in spring boot
Configurations are Spring Boot's core feature and idea is to do less in the code and more in the configuration. There is a bit of convention on the directory structure that one has to follow for the spring boot to get up and running. If you don't follow these basics, you are using the Spring Boot the wrong way.
Cheers!!