idea靈活使用 Spring boot 熱部署配置
1、引入jar包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2、idea 配置修改
-
組合鍵:“Shift+Ctrl+Alt+/” ,選擇 “Registry” ,選中打勾“compiler.automake.allow.when.app.running”
-
“File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,選中打勾 “Build project automatically” 。
-
3、配置application.yml
devtools:
restart:
enabled: false ## true時修改class文件自動重啓服務
exclude: congig/**,templates/**,static/** ## 靜態文件修改刷新頁面生效