SpringBoot2.X结合dev-tool 实现IDEA项目热部署

DBC 1.7K 0

步骤

  • pom文件添加依赖包
 <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>
        </plugins>
    </build>

IDEA配置

  • idea里面要设置,window和mac一样

SpringBoot2.X结合dev-tool 实现IDEA项目热部署插图

 

  • 使用快捷键打开,选择Registry
    注意默认快捷键:
    	window快捷键 Shift+Ctrl+Alt+/
    	mac快捷键 Shift+Command+Alt+/
    	
    如果自行修改了默认快捷键,则百度搜索相关博文,或者还原快捷键设置
    

    SpringBoot2.X结合dev-tool 实现IDEA项目热部署插图2

 

  • 选择compiler.automake.allow.when.app.running ,重启idea就行!!!

发表评论 取消回复
表情 图片 链接 代码

分享