devtools(热部署)
1 添加依赖(在需要热部署的module中)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
2 添加 maven 插件(在父工程里)
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.2.RELEASE</version>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>
3 开启项目热部署
4 开启项目运行时热部署
IDEA 2021.2以下的版本,需要 Ctrl + shift + A ,搜索registry,并按下图配置
Services(Run Dashboard)
高版本的 idea 不用通过 xml 来开启 Run Dashboard
不过它改名字了,叫做Service
他会默认出现在 idea 窗口的底层
若里面没有默认存在你的项目,可以通过点击下图的加号添加 运行配置类型
没看到services的话,可以通过view -> Tool Windows -> Services 开启