spring-boot使用热部署后在Eclipse中Debug调试就跳转到exitCurrentThread

【spring-boot使用热部署后在Eclipse中Debug调试就跳转到exitCurrentThread】spring-boot热部署可以当修改了class之后自动重启项目,方便调试。在pom.xml中添加

org.springframework.boot spring-boot-devtools true

在plugin中添加fork

org.springframework.boot spring-boot-maven-plugin true

配置后后可以自动重启。

但debug时发现,第一次启动会莫名进入SilentExitExceptionHandler.exitCurrentThread方法。看日志发现线程名从main变成了restartedMain,应该是此处引起线程退出,自己没有打断点,无法取消。百度一下,Eclipse有配置:window->【Preferences】->【Java】->【Debug】:去掉【Suspend execution on uncaught exceptions】前面的勾。
11:38:46.080 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/E:/workspace/nidap-logservice/target/classes/, file:/C:/workspace/pine-sql/target/classes/]._______ _ _ /\\ / ___'_ __ _ _(_)_ ____ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/___)| |_)| | | | | || (_| |) ) ) ) '|____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot ::(v2.0.1.RELEASE)2018-08-02 11:38:46.988INFO 31872 --- [restartedMain] c.t.n.logservice.LogServiceApplication: Starting LogServiceApplication on DESKTOP-U8R517O with PID 31872 (E:\workspace\nidap-logservice\target\classes started by admin in E:\workspace\nidap-logservice)


    推荐阅读