Spring Initializer, 임베디드 Tomcat, Thymeleaf 템플릿 엔진 및 패키지를 실행 가능한 JAR 파일로 사용하여 스프링 부트 웹 애플리케이션을 생성했습니다. 사용스프링 부트 2.0.0.M6의 스프링 스케줄링
기술 :
봄 부팅 2.0.0.M6, 자바 8 받는다는.
내가 콘솔에서 모든 메시지가 표시되지@SpringBootApplication
@EnableScheduling
@Import({SecurityConfig.class})
public class IberiaWebUtilsApplication {
public static void main(String[] args) {
SpringApplication.run(IberiaWebUtilsApplication.class, args);
}
}
하지만이 클래스 메시지마다 분
를 볼 것으로 예상
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()));
}
}
내 메인 클래스를 만들었습니다