Idea spring-boot设置热部署、热启动
首先了解一下什么是热部署、热启动
热部署:动态替换你修改的class,效率会更高。
热启动:修改代码保存时会自动重新启动项目。
1、引入热加载的插件
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
2、maven插件设置
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
3、编译设置:File->Settings->Build,Execution,Deployment->Compiler:选中 Build project automatically
4、运行设置:ctrl+shift+a 调起搜索,输入registry,点击第一项,打开Registry编辑框,找到compiler.automake.allow.when.
app.running
搞定!
还没有评论,来说两句吧...