当我们使用spring boot 创建工程,启动工程后如果我们需要更改工程文件时就需要重新启动工程,这给我们带来了很大的不方便,因此我们就需要引入devtools实现热部署,当修改文件后自动重新加载启动。
一、设置devtools
接着上一篇文章说,我们在“HelloWorld_SpringBoot”的spring boot工程项目上右键点击
“Spring Tools”—>”Add Boot Devtools”
这时pom.xml文件中会自动添加一个依赖
再来观察项目名出现的标记变化,会多一个devtools标记
此时该项目的任何文件进行修改保存后会都会自动重新部署。
二、关闭devtools
如果想取消热部署,可以右键“Spring Tools”–>Remove Boot Devtools即可。
欢迎转载,转载时请标明出。
查看更多文章请访问我的个人博客 www.bubblyyi.com
Good website! I truly love how it is simple on my eyes and the data are well written. I’m wondering how I could be notified whenever a new post has been made. I’ve subscribed to your RSS which must do the trick! Have a nice day!
Thank you for your attention. I would appreciate it if you could share my website with your friends!