springboot如何热部署(无需重启即可进行重新编译)
-
使用
spring-boot-devtools模块:Spring Boot DevTools 模块可以在修改代码后自动重新编译应用并且无需重启。在 pom.xml 文件中添加如下依赖:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <scope>runtime</scope> </dependency>在
application.properties或application.yml中添加如下配置:spring.devtools.restart.enabled=true spring.devtools.restart.additional-paths=src/main/java