专注于 JetBrains IDEA 全家桶,永久激活,教程
持续更新 PyCharm,IDEA,WebStorm,PhpStorm,DataGrip,RubyMine,CLion,AppCode 永久激活教程

SpringBoot系列之IDEA项目中设置热部署教程

1、新建SpringBoot项目

环境准备

  • JDK 1.8
  • SpringBoot2.2.1
  • Maven 3.2+
  • 开发工具
    • smartGit
    • IntelliJ IDEA2018

创建一个SpringBoot Initialize项目,详情可以参考我之前博客:SpringBoot系列之快速创建项目教程

50_1.png检查spring-boot-devtools是否加上?

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>

ps:修改如下配置,reload才生效,<fork>true</fork>,用于明确表示编译版本配置有效

50_2.png补充: 如果有加上Thymeleaf模板引擎,需要关了Thymeleaf缓存,然后按Ctrl+F9重新编译,修改配置文件:

spring:
  thymeleaf:
    cache: false

2、IntelliJ IDEA配置

Settings->Build,Execut, Deployment -> Compiler,勾选中左侧的Build Project automatically

50_3.png

Ctrl+Alt+Shift+/,选择Registry

50_4.png勾选complier.automake.allow.when.app.running 50_5.png

ok,next需要重启 IntelliJ IDEA,既可实现java文件自动构建,不过对于html还是要按Ctrl+F9编译

代码例子下载:code download

文章永久链接:https://tech.souyunku.com/26804

未经允许不得转载:搜云库技术团队 » SpringBoot系列之IDEA项目中设置热部署教程

JetBrains 全家桶,激活、破解、教程

提供 JetBrains 全家桶激活码、注册码、破解补丁下载及详细激活教程,支持 IntelliJ IDEA、PyCharm、WebStorm 等工具的永久激活。无论是破解教程,还是最新激活码,均可免费获得,帮助开发者解决常见激活问题,确保轻松破解并快速使用 JetBrains 软件。获取免费的破解补丁和激活码,快速解决激活难题,全面覆盖 2024/2025 版本!

联系我们联系我们