【spring】spring boot 開啓熱部署

開啓熱部署

1、pom添加

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-devtools</artifactId>
	<version>2.0.1.RELEASE</version>
	<optional>true</optional>
</dependency> 

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<configuration>
				<!-- 如果沒有該配置,devtools不會生效 -->
				<fork>true</fork>
				<!--支持靜態文件熱部署-->
				<addResources>true</addResources>
			</configuration>
		</plugin>
	</plugins>
</build>

2、Intellij IEDA開發工具
File->Setting->Build,…->Compiler 將右側project automatically勾上
在這裏插入圖片描述
使用ctrl+shift+a 快捷鍵搜索Registry,選擇搜索出來的第一個
在這裏插入圖片描述
找到compiler.automake.allow.when.app.running,勾上開啓此功能即可

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章