前言
在上一篇中,我们了解了quartz的基本使用,在项目中与springboot的整合是比较常见的方式,下面让我们来看看如何在springboot中集成quartz吧
1、引入pom
<!--spring boot集成quartz-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-quartz</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
2、配置文件无需做太多配置
server.port=8088
3、编写quartz.config类