- pom中添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<build>
<finalName>mscloud</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.5.RELEASE</version>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
2.设置自动编译

3.Update the value of
idea中使用 快捷键:ctrl+shift+alt+/


然后重启 IDEA
注意:开发阶段开启热部署,生产阶段必须关闭
在项目pom.xml中添加SpringBootDevTools依赖,设置为runtime和optional,配合spring-boot-maven-plugin插件进行自动编译。在IDEA中使用快捷键设置,开发阶段启用热部署以提高效率,但需确保生产环境关闭此功能。
1232

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



