1. 程式人生 > >idea配置SpringBoot熱部署之自動Build

idea配置SpringBoot熱部署之自動Build

一、pom.xml檔案匯入所需依賴檔案

SpringBoot熱部署外掛

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
            <scope>runtime</scope>
</dependency>

二、pom.xml檔案build標籤進行修改如下

該外掛由Maven提供,它會自動使用當前執行mvn命令的JDK去編譯Java原始碼。

<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration><fork>true</fork></configuration>
			</plugin>
		</plugins>
	</build>

三、開啟File==》Settings輸入Compiler勾選Buid project automatically點選OK

四、CTRL + SHIFT + A ==》 查詢Registry ==》勾選compiler.automake.allow.when.app.running即可