- 在
pom.xml
中添加依賴
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2.打開Idea的設置,在 compiler
中將 Build project automatically
選中
項目設置
-
打開Idea的全局搜索(在macOS中雙擊Shift鍵喚出),搜索registry
搜索打開registry
4.在registry
窗口中,將compiler.automake.allow.when.app.running
選中
在registry中設置
經(jīng)過以上設置,當項目運行的時候,修改模版文件,將不用重啟項目就能生效,修改java文件的時間,將會觸發(fā)自動重啟。