1.最好将idea的启动器设置一下

idea开发springboot项目时的自动编译和热部署

2.开启自动编译
file > settings > Build,Execution,Deployment > Compiler
勾选 Build project automatically

idea开发springboot项目时的自动编译和热部署

3.Crtl+Alt+Shift+/ 勾选 compiler.automake.allow.when.app.running

idea开发springboot项目时的自动编译和热部署

本人前两步这样设置之后就ok了,如果不行再往下看
4、在dependencies 下添加 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> </dependency>

5、在build > plugins > plugin 下添加 <configuration> <fork>true</fork> </configuration> 第四步有没有用我也没有试出来效果,添加第三步就会有效果了,但是这种设置会重启整个项目,可以放弃这种方式(和手动重启项目差不多)

相关文章:

  • 2021-05-08
  • 2022-12-23
  • 2021-12-27
  • 2021-12-11
  • 2021-05-29
  • 2021-04-20
猜你喜欢
  • 2021-05-31
  • 2021-08-06
  • 2021-06-11
  • 2021-04-07
  • 2021-05-08
相关资源
相似解决方案