欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

springboot:热部署

程序员文章站 2022-06-16 08:04:58
...
pom.xml:
==========================================
<!-- 支持热部署 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                </configuration>
                <dependencies>
                    <!-- spring热部署-->
                    <dependency>
                        <groupId>org.springframework</groupId>
                        <artifactId>springloaded</artifactId>
                        <version>1.2.7.RELEASE</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
==========================================
idea14:修改idea Compiler 勾选 make project automatically

高版本:
1、setting -> Compile -> Build project automatically --> 选中
2、COMMAND + SHIFT + ALT + / --> 查找Registry --> 找到并勾选compiler.automake.allow.when.app.running
==========================================
方式1:
在terminal中执行命令 mvn spring-boot:run
==========================================
方式2:
修改完类之后 Build---compile 'xxx.java'