idea編輯器下的spring boot 熱部署
阿新 • • 發佈:2019-02-01
①pom檔案中新增 devtools:
<!-- 熱部署模組 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <!-- 這個需要為 true 熱部署才有效 --> </dependency>
②pom檔案中新增 plugin:
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin>
③選單欄裡找到setting
④按快捷鍵 Shift+Ctrl+Alt+/ ,點選 Registry
⑤在application.properties/application.yml中
spring:
thymeleaf:
cache: false
freemarker:
cache: false
groovy:
template:
cache: false
velocity:
cache: false
⑥在chrome瀏覽器中 F12 >> 禁用快取
⑦執行專案即可。