關於springboot的啟動方式和熱部署情況
阿新 • • 發佈:2018-11-28
1.通過spingboot啟動類啟動 不能自動載入修改靜態檔案問題
yml中新增以下 devtools: restart: #熱部署生效 enabled: true #設定重啟的目錄 additional-paths: resources/**,static/**,templates/** #該目錄下的內容修改不重啟 exclude: com/** thymeleaf: cache: false
pom檔案新增以下:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency>
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build>
shift+ctrl+alt+/(我猜的,不敢保證,自己試一下),會彈出這個介面:
就選第一個,Resgistry
往下翻,找到這一條,打上勾,關閉
開啟設定
到目前為止就可以了