I've generated a Spring Boot web application using Spring Initializer, embedded Tomcat, Thymeleaf template engine, and package as an executable JAR file.
Technologies used:
Spring Boot 2.0.0.M6 , Java 8, maven.
I've created this class
com.iberia.task.scheduled
public class IberiaAssetHandlerJob {
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
@Scheduled(cron = "0 * * * * ?")
public void reportCurrentTime() {
System.out.println("The time is now {}" + dateFormat.format(new Date()));
}
}
expecting to see the message every minute
and my main class
@SpringBootApplication
@EnableScheduling
@Import({SecurityConfig.class})
public class IberiaWebUtilsApplication {
public static void main(String[] args) {
SpringApplication.run(IberiaWebUtilsApplication.class, args);
}
}
but I don't see any message in the console