微服务 springboot热部署

快来打我* 2023-01-12 04:20 215阅读 0赞

微服务 springboot热部署

  • 微服务 springboot热部署
    • 一、概念
    • 二、配置
      • 1.Adding devtools to your project
      • 2.Adding plugin to your pom.xml
      • 3.Enabling automatic build
      • 4.Update the value of
      • 5.重启IDEA
      • 6.验证

微服务 springboot热部署

一、概念

spring-boot-devtools就是为了每次修改代码而不需要手动重启而节约时间,提高开发效率。

spring的devtools实质不是一个真正的热部署工具,它是通过每次修改代码自动重新编译打包。
真正热部署工具官方推荐JRebel。

二、配置

1.Adding devtools to your project

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-devtools</artifactId>
  4. <scope>runtime</scope>
  5. <optional>true</optional>
  6. </dependency>

2.Adding plugin to your pom.xml

下一段配置黏贴到父工程当中的pom里

  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. <addResources>true</addResources>
  9. </configuration>
  10. </plugin>
  11. </plugins>
  12. </build>

3.Enabling automatic build

设置idea自动编译
在这里插入图片描述

4.Update the value of

自动编译设置快捷键:Ctrl+Shift+Alt+/
在这里插入图片描述在这里插入图片描述

5.重启IDEA

在这里插入图片描述

6.验证

Run Dashboard中的项目后缀都带[devtools]
每次修改代码之后自动编译。
在这里插入图片描述

发表评论

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

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

相关阅读

    相关 springboot部署

    需求分析 在我们开发的过程中,最烦的,最浪费时间的就是无论代码改动大小都要频繁的重启服务,而热部署正好解决了这样的问题 实现方案 springboot实现热部署的

    相关 SpringBoot部署

    一、什么是热部署 热部署,就是在应用正在运行的时候升级软件,却不需要重新启动应用。所谓热部署,就是在应用正在运行的时候升级软件,却不需要重新启动应用。 二、Sprin