springboot热部署

maven依赖

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>2.2.4.RELEASE</version>
        </dependency>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
    </build>

注意添加这段

<configuration>
    <fork>true</fork>
</configuration>

 

在设置中勾选Build project automatically,但是默认情况下只能在没有运行的条件下才生效,自然不能实现热部署,所以

快捷键ctrl + shift + alt + /   

进入Registry勾选compiler.automake.allow.when.app.running

 

最后在application.properties添加

spring.thymeleaf.cache=false

spring.devtools.restart.enabled=true

spring.devtools.restart.additional-paths=/src/main/java

 

posted @ 2020-03-10 19:31  rrrzx  阅读(201)  评论(0编辑  收藏  举报