Spring Boot 热部署

1、pom文件中导入 spring-boot-devtools 依赖:



    org.springframework.boot
    spring-boot-devtools
    true
    true

2、继续在pom.xml中添加插件:


    
        
            org.springframework.boot
            spring-boot-maven-plugin
            
                true
            

        

    

3、设置application.yml

spring:
    devtools:
       restart:
            enabled: true #设置开启热部署
            additional-paths: src/main/java #重启目录
            exclude: WEB-INF/**
        freemarker:
            cache: false #页面不加载缓存,修改即时生效

5、按住ctrl + shift + alt + /,出现如下图所示界面,点击Registry...,点击进入后,勾选compiler.automake.allow.when.app.running后关闭即可,如下图:
        

你可能感兴趣的:(Spring Boot 热部署)