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勾上
spring boot 开启热部署
使用ctrl+shift+a 快捷键搜索Registry,选择搜索出来的第一个
spring boot 开启热部署
找到compiler.automake.allow.when.app.running,勾上开启此功能即可
spring boot 开启热部署