1卵酪、spring boot配置文件設(shè)置如下
關(guān)閉thymeleaf緩存
spring:
thymeleaf:
encoding: UTF-8
mode: HTML5
cache: false
2幌蚊、idea中設(shè)置如下:
2.1、自動(dòng)builder
image.png
2.2溃卡、注冊(cè)一個(gè)快捷鍵
image.png
2.3溢豆、打開(kāi)剛剛注冊(cè)的快捷鍵,搜索compiler.automake...勾上
image.png
2.4瘸羡、以上操作在idea中已經(jīng)可以實(shí)現(xiàn)熱部署了漩仙,但是在eclipse中還不行,需要以下操作最铁。
(1)pom文件增加依賴和插件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.8.RELEASE</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
(2)開(kāi)啟Build Automatically讯赏。
注意有坑:項(xiàng)目中用到了quartz,獲取TestSuite一直報(bào)類型轉(zhuǎn)換錯(cuò)誤冷尉,com.picc.autoplateform.model.TestSuite cannot be cast to com.picc.autoplateform.model.TestSuite漱挎,TestSuite明明就是同一個(gè)東西,還轉(zhuǎn)換錯(cuò)誤了雀哨。把a(bǔ)dd boot devtools步驟中在pom文件增加的依賴包去掉就ok了磕谅。
JobDataMap dataMap = context.getJobDetail().getJobDataMap();
TestSuite testSuite = (TestSuite)dataMap.get("testSuite");