Spring Initializer、埋め込みTomcat、Thymeleafテンプレートエンジン、およびパッケージを実行可能なJARファイルとして使用して、Spring Boot Webアプリケーションを生成しました。使用Spring Boot 2.0.0.M6でのSpringスケジューリング
技術:
春ブーツ2.0.0.M6、Javaの8、達人。
私は
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()));
}
}
は、メッセージ毎分
と私のメインクラス
@SpringBootApplication
@EnableScheduling
@Import({SecurityConfig.class})
public class IberiaWebUtilsApplication {
public static void main(String[] args) {
SpringApplication.run(IberiaWebUtilsApplication.class, args);
}
}
を見ることを期待し、このクラスを作成しましたが、私は、コンソール内の任意のメッセージが表示されません