Annotation Interface EnableTask

Enables the TaskLifecycleListener so that the features of Spring Cloud Task will be applied.

 public class AppConfig {

        public MyCommandLineRunner myCommandLineRunner() {
                return new MyCommandLineRunner()
Note that only one of your configuration classes needs to have the @EnableTask annotation. Once you have an @EnableTask class in your configuration the task will have the Spring Cloud Task features available.
Glenn Renfro