首先在pom.xml当中集成依赖 ![](https://img.kancloud.cn/33/71/33717cab90f261e3f3d4486935bffe1b_1239x988.png) ### 然后创建定时任务要执行的具体的任务类 ![](https://img.kancloud.cn/1e/63/1e63d6c1b71c77bca0c28038d5cd7cf6_1307x721.png) ### 最后配置随着服务启动而启动的服务类 ![](https://img.kancloud.cn/10/63/10635fdefaed8a63dfb5977c1f3d5525_1566x993.png) ### 这样就在springboot当中集成号了quartz调度框架并设置了一个简单的要执行的任务类 ### ![](https://img.kancloud.cn/1a/ab/1aab14d6be11fcd42c83d97ca4335493_1378x338.png) 会随着服务的启动而启动