写给新手看的 Spring Boot 入门学习指南( 七 )

(1)在 dependency 中添加 optional 属性,并设置为 true:

写给新手看的 Spring Boot 入门学习指南

(2)在 plugin 中配置另外一个属性 fork,并且配置为 true:

写给新手看的 Spring Boot 入门学习指南

OK,以上两步配置完成,如果读者使用的是 Eclipse,那么恭喜你大功告成了。

如果读者使用的是 Idea 还需要做以下配置。

(3)配置 Idea

选择 File-Settings-Compiler 勾选 Build project automatically,低版本 Idea 勾选 make project automatically。

写给新手看的 Spring Boot 入门学习指南

使用快捷键:CTRL + SHIFT + A输入Registry找到选项 compile.automake.allow.when.app.running勾选

推荐阅读