热部署Devtools
1.添加devtools到项目中
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope><optional>true</optional>
</dependency>
2.添加plugin到项目中
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><!--建议写版本号与自己项目保持一致--><version>2.7.3</version><configuration><fork>true</fork><addResources>true</addResources></configuration></plugin></plugins>
</build>
3.idea开启自动编译打包
idea设置路径:Setting/Buid,Execution,Deployment/Compiler
开启(勾选)
- Automatically show first error in editor
- Display notification on build completion
- Build project automatically
- Compile independent modules in parallel
4.设置修改时更新
快捷键:Ctrl+Shift+Alt+/
5.重启idea
关闭idea,然后打开