SpringBoot笔记(三)IDEA实现devtools热部署

找了好几个文章,都是给个pom配置就完事了,根本不行,最后连查带试,算是弄出来了

设置pom.xml

dependencies

<!--springBoot工程实现热部署-->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
</dependency>

build->plugins

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <!--这里是新加的-->
    <configuration>
        <fork>true</fork>
    </configuration>
</plugin>

设置配置文件

application.properties或application.yml中禁用缓存

以下仅供参考,没有的就去掉,需要的就加上

spring.thymeleaf.cache=false
spring.freemarker.cache=false
spring.groovy.template.cache=false
spring.velocity.cache=false

开启IDEA自动编译

打开setting进行设置,然后确定
1

打开Maintenance选项卡选择Registry…

快捷键:

eclipse模式 Ctrl+Shift+Alt+/

IDEA模式 CTRL + SHIFT + A

2

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

3

好了,可以用了

还有一种情况是read artifactId failed,那么这说明没下载到资源,可以手动把jar包放到库里,也可以加上version版本号让ide去加载。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值