非常簡單的SpringBoot 在STS中實現熱部署
阿新 • • 發佈:2020-12-10
技術標籤:Spring BootSTS教程
1、pom.xml檔案新增devtools依賴包
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <scope>runtime</scope> <!-- 依賴不會傳遞,其他專案想要使用devtools, 需要重新引入 --> <optional>true</optional> </dependency>
2、application.properties 檔案配置
#熱部署
#thymeleaf不快取,即時重新整理,頁面修改後會立即生效
spring.thymeleaf.cache=false
#開啟devtools
spring.devtools.restart.enabled=true
#監聽目錄
spring.devtools.restart.additional-paths=src/main/java