ide 下spingboot 实现热部署

需要从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>

 

step2:
修改idea配置:
组合键:Ctrl+Alt+s  :  search:Compiler  勾选Build project antomatically
组合键:Ctrl+Alt+Shift+/ :选择第一个'Registry..'找到“complier.automake.allow.when.app.running”

原文地址:https://www.cnblogs.com/lanblogs/p/9843344.html