1. 程式人生 > >IDEA springboot專案修改檔案後無需重啟(熱部署)

IDEA springboot專案修改檔案後無需重啟(熱部署)

想在除錯springboot專案時,修改靜態資原始檔後不重啟可以通過下面兩步來達到目的

1、在pom中直接引入依賴

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>springloaded</artifactId>
    <version>1.2.6.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <version>1.3.0.RELEASE</version>
    <optional>true</optional>
</dependency>


2、設定以下兩項(第一項如已設定直接設定第二項)

1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,選中打勾 “Build project automatically” 。

2) 組合鍵:“Shift+Ctrl+Alt+/” ,選擇 “Registry” ,選中打勾 “compiler.automake.allow.when.app.running”

原文:https://blog.csdn.net/zht741322694/article/details/81583335