spring boot(二) spring boot实现热部署

spring boot(二) spring boot实现热部署

1.pom.xml文件添加

<!-- 热部署 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <optional>true</optional>
    <scope>true</scope>
</dependency>
<configuration>
    <!-- 没有该配置,devtools 不生效 -->
    <fork>true</fork>
    <addResources>true</addResources>
</configuration>

这里写图片描述

  1. File 》 Settings 》 Build,Execution,Deplyment 》 Compiler,选择 “Build project automatically”

    这里写图片描述

  2. 快捷键“Shift+Ctrl+Alt+/” ,选择 “Registry” ,选择 “compiler.automake.allow.when.app.running” (已经选择过的跳过)

  3. 在controller中修改代码,保存,控制台就会有重新部署的信息,打开浏览器验证即可

这里写图片描述

这里写图片描述

猜你喜欢

转载自blog.csdn.net/jiahao791869610/article/details/80268150