SpringBoot 热部署配置

devTools会监听classpath下的文件变动,并且会立即重启应用

pom.xml加入:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

build节点中,修改

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
    </build>

application.properties中加入配置:

spring.thymeleaf.cache=true

spring.devtools.restart.enable=true

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

 

posted @ 2020-09-26 22:39  陈鹏昱Chen  阅读(60)  评论(0编辑  收藏  举报