IDEA2022版本设置热部署

发布时间 2023-03-25 20:27:44作者: study_php_java

1、开启IDEA的自动编译(静态)
具体步骤:打开顶部工具栏 File -> Settings -> Build,Execution,Deployment -> Compiler 然后勾选 Build project automatically 。

2、 开启IDEA的自动编译(动态)
具体步骤:打开顶部工具栏 File -> Settings -> Advanced Settings -> Compiler -> 然后勾选 Allow auto-make to start even if developed application is currently running。
3、开启IDEA的热部署策略(非常重要)
具体步骤:点击Edit COnfigurations…进入

 

 选择Modif options -> On ‘Updata’ actrion -> Update classes and resources

4、在pom.xml文件中导入热部署插件

1.添加plugin到pom.xml
复制代码

<build>
    <plugins>
        <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <fork>true</fork>
          <addResources>true</addResources>
        </configuration>
      </plugin>
    </plugins>
 </build>
```java