方法一
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.1.RELEASE</version>
</parent>
<dependencies>
<!-- SpringBoot 核心组件 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
- 步骤二
- 在启动类上使用@EnableScheduling注解开启定时任务
@SpringBootApplication
@EnableScheduling
public class BigdataAttendanceApplication {
public static void main(String[] args) {
SpringApplication.run(BigdataAttendanceApplication.class, args);
}
}