大家好,又见面了,我是你们的朋友全栈君。
1、加载maven插件
<!--添加热部署-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
2、开启热部署
<!--热部署配置-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!--fork:如果没有该项配置,整个devtools不会起作用-->
<fork>true</fork>
</configuration>
</plugin>
1)设置IDEA的自动编译:
“File”→“Settings(Ctrl+Alt+S)”→“Build, Execution, Deplyment”→“Compiler”,选中“Build project automatically” 打勾
2)组合键 Shift+Ctrl+Alt+/,选择 Registry ,找到compiler.automake.allow.when.app.running,选中打勾。(或者CTRL + SHIFT + A –> 查找Registry)
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/106434.html原文链接:https://javaforall.cn