SET
Jvm argument
Jvm arguments are begun with ‘-D’.
1 | java -jar -Dfoo heumsi-springboot.jar |
Application argument
Application arguments are begun with ‘—‘.
1 | java -jar --bar heumsi-sprinboot.jar |
GET
application.properties
the arguments can be stored at ‘application.properties’ file as key-value type. and It can is approached using @Value in Java code.
1 | // set value in application.properties |
Environment
You can approach the arguments without ‘.properties’ file using Environment object.
1 |
|