在之前我们学习Spring框架的时候,如果说修改项目内容,必须重新启动服务器才能运行项目,而学习了热部署后,我们使用Springboot项目就可以直接修改后刷新即可。
1.先在pom.xml中添加依赖:
<!--热部署,需要为true-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
2.打开Setttings—>找出compiler—>勾选上Build project automatically
3.shift+ctrl+alt+/,打开registry,勾选上xxxxxx.app.running