热部署
-
pom.xml导包
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> </dependency>
-
打开自动编译
依次Setting → Build,Execution,Deployment → Compiler,勾选Build project automatically
-
两种方案①idea2021.2以前版本,②idea2021.2以后版本
①idea2021.2以前版本
-
双击Shift,搜索输入registry
-
勾选compiler.automake.allow.when.app.running,点击Restore Defaults
②idea2021.2以后版本
-
在registry中找不到compile.automake.allow.when.app.running,要去Setting中找
-
依次在找Setting → Advanced,勾选Settingscompile.automake.allow.when.app.running
-