Idea的SpringBoot项目热部署不生效解决办法,SpringBoot使用Jrebel

1. 添加依赖开启热部署

        <!-- 开启热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <!-- 设置为true 热部署才有效 -->
            <optional>true</optional>
            <scope>true</scope>
        </dependency>

2. 配置插件,让依赖生效

			<!--  配置插件,让热部署依赖spring-boot-devtools生效 -->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 设置为true,让热部署devtools生效 -->
                    <fork>true</fork>
                    <addResources>true</addResources>
                </configuration>
            </plugin>

3. 设置开启自动构建项目

File -> Settings -> 搜索Compiler -> 开启`Build Project automatically`

在这里插入图片描述

4. 改变注册表,开启Compiler.autoMake.allow.when.app.running

双击Shift,输入registry搜索找到Action的Registry,然后开启Compiler.autoMake.allow.when.app.running
在这里插入图片描述
在这里插入图片描述

5. 将项目设置为update classes and resources

在这里插入图片描述

在这里插入图片描述

6. 将项目加入到Jrebel中

在这里插入图片描述
在这里插入图片描述

评论 45
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值