天天看点

IDEA中配置热部署

一、在pom.xml文件中添加依赖

<!-- 热部署 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
           

二、IDEA开启项目自动编译

IDEA左上角–>file–>Settings,找到Build,Execution,DepLoyment–>Compiler,并勾选Build project automatically。

IDEA中配置热部署

三、IDEA开启项目运行时自动make

通过

ctrl+shift+alt+/

快捷键进入Maintenance,进入registry,勾选compiler.automake.allow.when.app.running

IDEA中配置热部署

四、重启IDEA,完成

五、如果不能用,可以同时关闭浏览器缓存

IDEA中配置热部署

继续阅读