spring boot 整合定时任务

作者: 戈寸言 | 来源:发表于2019-07-18 10:32 被阅读40168次

开发环境

idea2016

jdk1.8

win7

新建项目

按下图操作:

打卡pom.xml,添加以下依赖

<dependency>  

 <groupId>org.quartz-scheduler

  <artifactId>quartz

  <version>2.2.1

        <artifactId>slf4j-api

        <groupId>org.slf4j

</dependency>

新建TaskJob类,代码如下 cron表达式输入你要执行的时间,启动项目看是否成功 如图所示已经输出了this is task job!定时任务就这么简单

相关文章

网友评论

    本文标题:spring boot 整合定时任务

    本文链接:https://www.haomeiwen.com/subject/heeklctx.html