成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

Intellij IDEA實現(xiàn)springboot熱部署過程解析

瀏覽:18日期:2023-04-29 15:05:56

對于springboot熱部署貌似是這樣的,首先要設(shè)置idea相關(guān)配置

導(dǎo)航欄 File -> Settings -> Build,Execution,Deployment -> Compiler 選擇Build project automatically 打勾 如下圖所示

Intellij IDEA實現(xiàn)springboot熱部署過程解析

接著Ctrl+Shift+Alt+/ 快捷鍵選擇Registry會彈出如下圖

Intellij IDEA實現(xiàn)springboot熱部署過程解析

在紅色選擇的一行打勾,就完成了這步驟。

接著開始配置pom.xml文件

<dependencies><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional></dependency></dependencies><build><plugins> <!-- springboot maven plugin --> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--fork : 如果沒有該項配置,肯定devtools不會起作用,即應(yīng)用不會restart --> <fork>true</fork> </configuration> </plugin></plugins></build>

pom文件也配置好了,就開始配置application.yml (或者 application.properties)

#THYMELEAF spring: thymeleaf: cache: false #這里一定要設(shè)置false prefix: classpath:/thymeleaf/ suffix: .html mode: HTML5 encoding: UTF-8 devtools:restart:#熱部署生效trueenabled: true #設(shè)置重啟的目錄 additional-paths: resources/**,static/**,templates/**#該目錄下的內(nèi)容修改不重啟 exclude: data/**

配置完之后,基本上就可以運行了,還有最后要記得瀏覽器要設(shè)置 禁止緩存

Intellij IDEA實現(xiàn)springboot熱部署過程解析

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標簽: Spring
相關(guān)文章: