1、pom 包配置
pom 包里面只需要引入 Spring Boot Starter 包即可
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
启动类启用定时
在启动类上面加上 @EnableScheduling即可开启定时