版权声明:powered by 大狼狗郑锴/Moshow魔手 https://blog.csdn.net/moshowgame/article/details/81129860 </div>
<link rel="stylesheet" href="https://csdnimg.cn/release/phoenix/template/css/ck_htmledit_views-3019150162.css">
<div id="content_views" class="markdown_views prism-atom-one-dark">
<!-- flowchart 箭头图标 勿删 -->
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>
</svg>
<h2 id="问题背景"><a name="t0"></a>问题背景</h2>
初次使用Intellij的同学都会遇到这个问题,即使项目使用了spring-boot-devtools+spring-boot-loader,修改了java文件或者html、js文件等,idea还是不会自动热部署,需要ctrl+f5手动一下
没有热部署简直就很不开心。出现这种情况,并不是你的问题,是IDEA和DevTools和Loader的配置问题,Intellij IEDA和Eclipse不同,Eclipse一般设置了自动编译,而IDEA需要自己打开。
解决方案
再setting->Build,Execution,Deployment->Compiler找到 Build Project Automatically。
这个选项再Eclipse是默认打开的,再IDEA要手动打开。
然后找个地方ctrl+shift+alt+/ 调出Maintenance(维护)控制台,选择Registry(登记)
勾选运行时自动编译(auto-making when app running)
就解决了!