Fork me on GitHub

热部署Devtools

热部署Devtools

热部署的作用,方便代码修改,在代码修改后,无需再次重新运行代码。

  1. pom文件配置maven的jar包
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>runtime</scope>
    <optional>true</optional>
</dependency>
  1. Adding plugin to your pom.xml

    <build>
        <finalName>你自己的工程名字</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                    <addResources>true</addResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
  2. 设置自动编译

  1. 在pom.xml下设置Registry自动编译

  1. 最后重启Idea
posted @ 2022-03-14 22:28  壶小旭  阅读(27)  评论(0编辑  收藏  举报