1.需要在pom.xml中加入devtools依賴
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency>
2.、然后到setting框中,輸入compiler,然后勾選Build project automatically
3然后按住shift+alt+ctrl+/,進入maintenance,然后選擇進入Registry
4、勾選compiler.automake.when.app.running
這樣就可以實現自動重啟服務器
然后按住shift+alt+ctrl+/,進入maintenance,然后選擇進入Registry