一、项目pom.xml添加devtools依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
二、父工程添加插件
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
三、设置自动构建
File -> Settings -> Build,Execution,Deployment -> Compiler -> 选中Build project automatically

四、按快捷键 “ctrl+shift+alt+/”
显示如下菜单,点击Registry选项

找到
compiler.automake.allow.when.app.running
actionSystem.assertFocusAccessFromEdt
选项,选中后面的复选框

本文介绍了如何在IntelliJ IDEA中配置Spring Boot的devtools依赖以实现应用的热部署,同时详细步骤指导如何设置Maven插件以支持自动编译,并启用IDEA的自动构建功能,提高开发效率。
5231

被折叠的 条评论
为什么被折叠?



