ideal中配置熱更新問題:配置好以後前端無法更新
阿新 • • 發佈:2020-06-30
1.pom檔案下配置依賴:
<!-- 熱跟新 --> <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> </configuration> </plugin>
2.在application.properites中配置
#開啟或關閉
spring.devtools.restart.enabled=true
#新增那個目錄的檔案需要restart
spring.devtools.restart.additional-paths=src/main/java
#排除那個目錄的檔案不需要restart
spring.devtools.restart.exclude=static/**,public/**
#禁止thymeleaf快取(建議:開發環境設定為false,生成環境設定為true)
spring.thymeleaf.cache=false
3.在settings>Compiper>Build inde.... √
4.ctr+shift+alt+/ ->Resgis...> ...app.running √
5.【前端專案無法更新時是此處為修改】Eidt Configration > server > On Update 和On frame ...選項都選擇Update classess and resources