> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iii.-using-spring-boot/20.-developer-tools/20.2.-automatic-restart/20.2.5.-using-a-trigger-file.md).

# 20.2.5. 使用触发器文件

如果使用一个IDE连续不断地编译变化的文件，你可能倾向于只在特定时间触发重启，触发器文件可以帮你实现该功能。触发器文件是一个特殊的文件，只有修改它才能实际触发一个重启检测。改变该文件只会触发检测，实际的重启只会在Devtools发现它必须这样做的时候。触发器文件可以手动更新，也可以通过IDE插件更新。

为了使用触发器文件，把`spring.devtools.restart.trigger-file`属性设置为你的触发器文件的路径。

**注** 你可能想将`spring.devtools.restart.trigger-file`属性设置为[全局设置](https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#using-boot-devtools-globalsettings)，这样所有的工程表现都会相同。
