找了网上的两篇文章结合在一起才好用了,在这里做个日志记录:
原文链接:http://blog.csdn.net/xusheng_Mr/article/details/78771746
原文链接:http://blog.csdn.net/my__sun_/article/details/72377281
idea:实现springboot热部署
需要从maven中下载devtools插件pom.xml:step1:
修改pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
<scope>true</scope>
</dependency>
</dependencies>
<build>
...
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 如果没有该项配置,devtools不会起作用,即应用不会restart -->
<fork>true</fork>
</configuration>
</plugin>
</build>
修改idea配置:
组合键:Ctrl+Alt+s : search:Compiler 勾选Build project antomatically
组合键:Ctrl+Alt+Shift+/ :选择第一个'Registry..'找到“complier.automake.allow.when.app.running”