spring-boot使用dev-tools实现热部署

1.在pom文件添加maven配置


		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<optional>true</optional>
			<scope>true</scope>
		</dependency>
<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
				<!--特别要注意,要加入这个fork,否则不能dev-tools不能实现热部署-->
					<fork>true</fork>
				</configuration>
			</plugin>
		</plugins>
	</build>

如果添加了这个还不可以,那么需要设置idea:

检查如下设置:

按shift+ctrl+alt+/

这样修改了类文件,就自动重启了

猜你喜欢

转载自blog.csdn.net/u011662320/article/details/82290493