微服务、springboot热部署

添加热部署依赖,如果项目中已有就不用加了

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

 

1.依次打开工具栏

File -> Settings -> Default Settings -> Build -> Compiler

开启自动编译:Build project automatically

 

2.开启idea的自动编译

快捷进入:Ctrl+Shift+A 或者Alt 

搜索:Registry

 

勾选允许自动编译

 

3.启动类配置

Update classes and resources:运行按钮就更新

Do nothing:检测到改变就更新

 

4.热部署

热部署编译快捷键Crl + Shift + F9

非快捷键编译

编译该项目模块

 

编译指定类

 

亲测有效,适用于springboot和微服务项目中

posted @ 2024-01-19 11:29  安详的苦丁茶  阅读(50)  评论(0编辑  收藏  举报