- 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 -Dmy.config.value="From System Config" -jar ./build/libs/bookpub-0.0.1-SNAPSHOT-exec.jar so as to see the following in the logs:
2017-12-17 --- ication$$EnhancerBySpringCGLIB$$b123df6a : Value of my.config.value property is: From System Config
- If we want to be able to set the Java system property while running our application using the Gradle's bootRun task, we will need to add this to the applicationDefaultJvmArgs configuration in the build.gradle file. Let's add -Dmy.config.value=Gradle to this list and start the application by running ./gradlew clean ...