IDEA 在Mac下的热部署配置步骤,话不多说,直接上

1、pom文件中添加依赖

<!-- 开启热部署 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>runtime</scope>
    <optional>true</optional>
</dependency>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <!-- 开启热部署 -->
            <configuration>
                <fork>true</fork>
            </configuration>
        </plugin>
    </plugins>
</build>

2、IntelliJ IDEA--Preferences……进入Preferences配置页面,或者用快捷键 command+, 3、勾选Build preject automatically,点Apply,点击OK。

4、连续按两次shift键,打开选择框,输入reg,选择“Registry……”

5、勾选compiler.automake.allow.wher.app.running,点Close关闭。

6、项目中选择“Edit Configurations……”

7、On 'Update' action和On frame deactivation都选择:Update classes and resources,点击Apply,点击OK。