有两种方法:
第一种当然你可以把Scheduled写到xml文件中进行配置。

第二种在你的类前面添加

 

此处讲解第二种写法


第二种在你的类前面添加
@PropertySource("classpath:root/test.props")


然后修改你的@Scheduled(cron="0/5 * * * * ? ") 为 @Scheduled(cron="${jobs.schedule}")
最后在配置文件 test.props中 添加 jobs.schedule = 0/5 * * * * ?

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
相关资源
相似解决方案