IntelliJ IDEA配置Springboot2.x 通过devtools实现代码热部署,提高调试效率

1、pom.xml添加依赖:

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

2、菜单File > Settings > Complier > 选中 Build project automatically :
在这里插入图片描述

3、使用该组合键 Shift+ALT+Ctrl+/ ,选择 Registry ,然后:

勾选complier.automake.allow.when.app.running

设置compiler.automake.postpone.when.idle.less.than 延时热部署时间为500(单位是毫秒),也就是保存后500毫秒内触发代码热部署。

如下图所示
在这里插入图片描述
官方文档有说明:
在这里插入图片描述

/META-INF/maven, /META-INF/resources, /resources, /static, /public, /templates
默认情况下,这些文件资源不会自动重新加载,但是我们可以通过 spring.devtools.restart.exclude 属性进行配置从而排除某些文件。

转载于:https://www.cnblogs.com/xiaocy66/p/10589268.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值