1. 添加依賴開啟熱部署
<!-- 開啟熱部署 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- 設定為true 熱部署才有效 -->
<optional>true</optional>
<scope>true</scope>
</dependency>
2. 配置插件,讓依賴生效
<!-- 配置插件,讓熱部署依賴spring-boot-devtools生效 -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 設定為true,讓熱部署devtools生效 -->
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
3. 設定開啟自動構建專案
File -> Settings -> 搜索Compiler -> 開啟`Build Project automatically`

4. 改變注冊表,開啟Compiler.autoMake.allow.when.app.running
雙擊Shift,輸入registry搜索找到Action的Registry,然后開啟Compiler.autoMake.allow.when.app.running


5. 將專案設定為update classes and resources


6. 將專案加入到Jrebel中


轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/229243.html
標籤:其他
