Let's continue our experiments by setting the my.config.value configuration property. Build the application by running ./gradlew clean bootJar and start it by running java -jar ./build/libs/bookpub-0.0.1-SNAPSHOT-exec.jar --spring.application.json={"my":{"config":{"value":"From external JSON"}}} so as to see the following in the logs:
2017-12-17 --- ication$$EnhancerBySpringCGLIB$$b123df6a : Value of my.config.value property is: From external JSON
If we want to be able to set the content using Java system properties, we can use -Dspring.application.json instead, assigning the same JSON content as the value.
Alternatively, we can also rely on the SPRING_APPLICATION_JSON environment variable to pass the same JSON content in the following way: