Spring boot热部署devtools过程解析
作者:Mars.wang 时间:2022-06-21 13:12:09
1 pom.xml文件
注:热部署功能spring-boot-1.3开始有的
<!--添加依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<!-- optional=true,依赖不会传递,该项目依赖devtools;之后依赖myboot项目的项目如果想要使用devtools,需要重新引入 -->
<optional>true</optional>
</dependency>
注:project 中添加 spring-boot-maven-plugin,主要在eclipse中使用,idea中不需要添加此配置。
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
2 更改idea配置
1) “File” -> “Settings” -> “Build,Execution,Deplyment” -> “Compiler”,选中打勾 “Build project automatically” 。
2) 组合键:“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选中打勾 “compiler.automake.allow.when.app.running” 。
3 Chrome禁用缓存
F12或者“Ctrl+Shift+I”,打开开发者工具,“Network” 选项卡下 选中打勾 “Disable Cache(while DevTools is open)”
来源:https://www.cnblogs.com/wangbin2188/p/9188171.html
标签:spring,boot,热部署,devtools
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
基于idea 的 Java中的get/set方法之优雅的写法
2023-11-26 20:22:50
![](https://img.aspxhome.com/file/2023/2/60092_0s.jpg)
SpringMVC框架整合Junit进行单元测试(案例详解)
2022-04-10 20:53:37
![](https://img.aspxhome.com/file/2023/9/61029_0s.png)
深入理解Java8新特性之接口中的默认方法和静态方法
2023-11-24 01:44:25
![](https://img.aspxhome.com/file/2023/9/59759_0s.png)
Java编程BigDecimal用法实例分享
2022-05-02 05:40:06
Groovy的规则脚本引擎实例解读
2023-07-11 21:24:04
![](https://img.aspxhome.com/file/2023/6/65186_0s.jpg)
Java中BigDecimal的舍入模式解析(RoundingMode)
2021-10-16 15:28:16
Java中List使用stream流转成map的几种方式详解
2022-07-31 21:46:12
Java高级面试题小结
2023-11-23 07:34:00
Android 应用签名的两种方法
2023-07-29 14:02:04
Java 中很好用的数据结构EnumSet
2023-12-06 09:37:23
![](https://img.aspxhome.com/file/2023/5/64395_0s.webp)
Android 5秒学会使用手势解锁功能
2023-07-11 13:48:32
![](https://img.aspxhome.com/file/2023/1/83511_0s.gif)
Android 消息机制问题总结
2023-08-06 03:10:49
![](https://img.aspxhome.com/file/2023/5/84715_0s.jpg)
关于idea中SpringBoot启动失败的坑
2022-07-18 13:02:24
![](https://img.aspxhome.com/file/2023/4/62234_0s.png)
c# 获取CookieContainer的所有cookies函数代码
2023-06-17 23:11:30
详细总结Java堆栈内存、堆外内存、零拷贝浅析与代码实现
2023-11-21 01:52:29
![](https://img.aspxhome.com/file/2023/5/59325_0s.png)
浅谈Java消息队列总结篇(ActiveMQ、RabbitMQ、ZeroMQ、Kafka)
2022-06-13 01:30:40
![](https://img.aspxhome.com/file/2023/8/60698_0s.jpg)
十分钟速懂java知识点 System类
2022-11-25 04:19:26
![](https://img.aspxhome.com/file/2023/4/64894_0s.png)
Spring Data JPA 映射VO/DTO对象方式
2022-10-13 10:25:27
Hibernate实现批量添加数据的方法
2023-11-29 08:53:56
![](https://img.aspxhome.com/file/2023/5/60815_0s.jpg)
Java如何基于ProcessBuilder类调用外部程序
2023-11-27 20:19:57
![](https://img.aspxhome.com/file/2023/0/59210_0s.png)