springboot热部署工具
生活随笔
收集整理的這篇文章主要介紹了
springboot热部署工具
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
為了進一步提高開發(fā)效率,springboot為我們提供了全局項目熱部署,日后在開發(fā)過程中修改了部分代碼以及相關(guān)配置文件后,不需要每次重啟使修改生效,在項目中開啟了springboot全局熱部署之后只需要在修改之后等待幾秒即可使修改生效。
開啟熱部署
項目中引入依賴 (每次搭建項目都需要引入)
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><optional>true</optional> </dependency>設置idea中支持自動編譯(只需要設置一次)
# 1.開啟自動編譯Preferences | Build, Execution, Deployment | Compiler -> 勾選上 Build project automatically 這個選項# 2.開啟允許在運行過程中修改文件ctrl + alt + shift + / ---->選擇1.Registry ---> 勾選 compiler.automake.allow.when.app.running 這個選項啟動項目檢測熱部署是否生效
# 1.啟動出現(xiàn)如下日志代表生效 2019-07-17 21:23:17.566 INFO 4496 --- [ restartedMain] com.baizhi.InitApplication : Starting InitApplication on chenyannandeMacBook-Pro.local with PID 4496 (/Users/chenyannan/IdeaProjects/ideacode/springboot_day1/target/classes started by chenyannan in /Users/chenyannan/IdeaProjects/ideacode/springboot_day1) 2019-07-17 21:23:17.567 INFO 4496 --- [ restartedMain] com.baizhi.InitApplication : The following profiles are active: dev 2019-07-17 21:23:17.612 INFO 4496 --- [ restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@66d799c5: startup date [Wed Jul 17 21:23:17 CST 2019]; root of context hierarchy 2019-07-17 21:23:18.782 INFO 4496 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8989 (http) 2019-07-17 21:23:18.796 INFO 4496 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-07-17 21:23:18.797 INFO 4496 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.20注意:日志出現(xiàn)restartedMain代表已經(jīng)生效,在使用熱部署時如果遇到修改之后不能生效,請重試重啟項目在試
超強干貨來襲 云風專訪:近40年碼齡,通宵達旦的技術(shù)人生總結(jié)
以上是生活随笔為你收集整理的springboot热部署工具的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: springboot日志处理
- 下一篇: springboot对象方式注入