IDEA 热启动,每次更改代码后不用重启服务

1、ctrl+Shift+Alt+/,选择Registry

2、勾选 compiler.automake.allow.when.app.running(可能不按首字母排序,可以多找找)

3、Setting--->Compiler--->勾选Build project automatically

4、pom.xml增加依赖(这种方式值适用于springboot项目)

复制代码
<!-- 热部署模块 -->
<dependency>
    <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> <!-- 这个需要为 true 热部署才有效 -->
</dependency>
复制代码
复制代码
<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                </configuration>
            </plugin>
        </plugins>
</build>
复制代码

https://www.cnblogs.com/wangzh1guo/p/9723778.html

猜你喜欢

转载自www.cnblogs.com/yuluoxingkong/p/12021540.html