idea 2021 使用devtools
1、勾选自动编译
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-EEdBarzN-1645413152625)(C:\Users\baopengliang\AppData\Roaming\Typora\typora-user-images\image-20220221110723215.png)]
2、勾选运行时自动重新编译
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JJYTesqG-1645413152626)(C:\Users\baopengliang\AppData\Roaming\Typora\typora-user-images\image-20220221110822964.png)]
3、引入maven 依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
4、设置pom
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
5、重启idea
本文介绍了如何在IntelliJ IDEA 2021中启用Spring Boot DevTools,包括自动编译和运行时重编译配置,以及如何在pom.xml中添加相关依赖和Maven插件配置。一步步教你实现高效开发环境的搭建。
497

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



