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