springboot热启动

1.在pom文件中添加maven依赖


	org.springframework.boot
	spring-boot-devtools
	true
	true

2.将下面的代码是放在  下面里的


	
	org.springframework.boot
	spring-boot-maven-plugin
	
	
	true
	

3.File----》Setting---》complier---》勾选上Build Project automatically

springboot热启动_第1张图片

4.快捷键 ctrl + shift + alt + /,选择Registry,勾上 Compiler autoMake allow when app running

.springboot热启动_第2张图片

这样我们的热部署就完成了,可以再我们的项目中修改返回值,或者修改Mapping的value值后,在我们的页面中刷新试试。

修改前

springboot热启动_第3张图片

在浏览器中访问

springboot热启动_第4张图片

将100换成10,无需重启,再次在浏览器访问

springboot热启动_第5张图片

我们的修改已经生效了,不用通过再关闭再开启项目查看了。

你可能感兴趣的:(springboot)