6、添加路径
使用spring.devtools.restart.additional-paths
来添加非classpath的文件路径,添加后的路径下文件修改后会导致重启。
7、取消重启
你可以在application.properties
下设置spring.devtools.restart.enabled=false
来取消重启。这样做仍然会初始化restart类加载器,但它不会监视文件更改。
如果要完全关闭重启功能,需要在调用SpringApplication.run(…)前关闭,如:
public static void main(String[] args) {
System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(MyApp.class, args