October 2018
Intermediate to advanced
982 pages
23h 29m
English
If we run our application again, by executing $ ./gradlew clean bootRun, we will get an output that is similar to the previous one. However, we will see our Hello message in the logs as well, which is as follows:
2017-12-16 21:57:51.048 INFO --- com.example.bookpub.StartupRunner : Hello
Even though the program will get terminated on execution, at least we made it do something!
Command-line runners are a useful functionality to execute the various types of code that only have to be run once, after startup. Some also use this as a place to start various executor threads, but Spring Boot provides a better solution for this task, which will be discussed at the end of this chapter. The command-line runner interface is used by ...
Read now
Unlock full access