● 開發工具
Maven+SpringBoot2.1.3+jdk10+Idea
● 主要步驟
STEP1 構建SpringBoot項目.
具體流程如下:file→new→project→SpringInitializr→選擇服務URL→next→設置Gruop和Artifact→左右均選擇Web.
STEP2 設置pom.xml文件,並添加相應依賴.具體如下:
1、添加Spring-boot-devtools依賴
值得注意的是:圖中<optional>標簽配置不可省略
2、設置插件spring-boot-maven-plugin
STEP3設置自動編譯. 為了使熱加載在SpringBoot項目中生效. 需進行automatically配置, 主要包括兩方面.
1、File→Settings…→Build,Execution,Deployment→Compiler→勾選Buildprojectautomatically→確定
2、Ctrl+Shift+A→搜索Registry並選擇Registry….→勾選compiler.automake.allow.when.app.running