天天看點

idea spring boot項目調試不用每次重新開機

1.ctrl+Shift+Alt+/-----> 選擇Registry ------>勾選

compiler.automake.allow.when.app.running

2.如果你進行上面的設定沒有作用,請在檢查下面圖檔的設定

Setting--->Compiler--->勾選Build project automatically

idea spring boot項目調試不用每次重新開機

3.maven 加入依賴

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId>
   <optional>true</optional> <!-- 表示依賴不會傳遞 -->
</dependency>
           
<plugin>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-maven-plugin</artifactId>
   <configuration>
      <fork>true</fork> <!-- 如果沒有該配置,devtools不會生效 -->
   </configuration>
</plugin>