SpringBoot 热部署。

SpringBoot 热部署。


文章目录

    • [SpringBoot 热部署。](#SpringBoot 热部署。)

  • pom.xml。
xml 复制代码
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>

使用 optional=true 表示依赖不会传递,即该项目依赖 devtools,其他项目如果引入此项目生成的 JAR 包,则不会包含 devtools。

  • application.yaml。
yaml 复制代码
spring:
  devtools:
    restart:
      # 热部署生效。
      enabled: true
      # 设置重启目录。
      additional-paths: src/main/java
      # 设置 classpath 目录下 WEB-INF 文件夹内容修改不重启。
      exclude: static/**
  • Intellij IDEA 配置。

按 Ctrl + Shift + Alt + / 快捷键调出 Maintenance 页面,单击 Registry,勾选 compiler.automake.allow.when.app.running 复选框。

相关推荐
昨天的猫6 小时前
《拒绝重复代码!模板模式教你优雅复用算法骨架》
后端·设计模式
一起养条鱼吧6 小时前
🧩 Argon2 密码哈希
人工智能·后端
QZQ541886 小时前
使用C++实现一个简易的线程池
后端
shark_chili6 小时前
基于魔改Nightingale源码浅谈go语言包模块管理
后端
回家路上绕了弯6 小时前
用户中心微服务设计指南:从功能到非功能的全维度落地
后端·微服务
Main121386 小时前
Java Duration 完全指南:高精度时间间隔处理的利器
后端
q***31836 小时前
微服务生态组件之Spring Cloud LoadBalancer详解和源码分析
java·spring cloud·微服务
用户3459474113616 小时前
Android系统中HAL层开发实例
后端
undefined在掘金390416 小时前
第二节 Node.js 项目实践 - 使用 nvm 安装 Node.js
后端
小码编匠6 小时前
.NET 10 性能突破:持续优化才是质变关键
后端·c#·.net