SpringBoot设置热部署(超详细)【IDEA版】

分手后的思念是犯贱 2022-11-15 15:55 267阅读 0赞

SpringBoot开始热部署(超详细)

  • 1、添加devtools的依赖
  • 2在maven-plugin上添加configration
  • 3、修改idea的设置,打开自动编译
  • 4、修改idea的设置允许在程序运行过程中编译

1、添加devtools的依赖

  1. <!--devtools-->
  2. <dependency>
  3. <groupId>org.springframework.boot</groupId>
  4. <artifactId>spring-boot-devtools</artifactId>
  5. </dependency>

2在maven-plugin上添加configration

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.springframework.boot</groupId>
  5. <artifactId>spring-boot-maven-plugin</artifactId>
  6. <configuration>
  7. <fork>true</fork>
  8. </configuration>
  9. </plugin>
  10. </plugins>
  11. </build>

3、修改idea的设置,打开自动编译

在这里插入图片描述

4、修改idea的设置允许在程序运行过程中编译

快捷键键:CTRL+SHIFT+ALT+/

在这里插入图片描述
在这里插入图片描述

这样设置后,只要我们修改完代码,并且鼠标失去焦点(鼠标移开)后,这样idea就会自动编译并且springboot就会重新部署,不用手动操作了。

以上就是SpringBoot设置热部署(超详细)【IDEA版】的全部内容。

看完如果对你有帮助,感谢点赞支持!
如果你是电脑端的话,看到右下角的 “一键三连” 了吗,没错点它[哈哈]

在这里插入图片描述

加油!

共同努力!

Keafmd

发表评论

表情:
评论列表 (有 0 条评论,267人围观)

还没有评论,来说两句吧...

相关阅读