Intellij Idea Spring Boot 热部署
-
勾选
-
在POM文件中添加依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
-
在POM文件中添加插件
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--fork : 如果没有该项配置devtools不会起作用,即应用不会restart --> <fork>true</fork> <addResources>true</addResources><!--支持静态文件热部署--> </configuration> </plugin>
- 网上很多教程没有这一步,我没有这一步是不行的。
Windows 是 Shift+Ctrl+Alt+/,Mac把Ctrl改为command 。选择Registry
然后勾选
重启。就可以了