Runner
Spring allows command-line runners to be implemented, which can execute code during application startup. These are primarily intended for development and administrative tasks, but they can also be used in production when required. The available runners are listed below. Refer to the JavaDoc of each class for usage instructions and implementation details.
| Runner | Description |
|---|---|
| SeedRunner | YAML import interface for initializing the database, see Seeding. |
Runners can be executed with:
gradle bootRun --args='<taskName> <arg1> <arg2> ...'
When the application starts, Spring calls all runners. Each runner checks the provided taskName and executes only if the taskName matches with that of the runner. When using IntelliJ, you can create a Run/Debug configuration to execute a runner directly from within the IDE. Runners can also be executed through Docker. See docker-compose.seed.yml
in the demo for an example.