美文网首页
spring 项目开启热部署

spring 项目开启热部署

作者: RayGor | 来源:发表于2020-12-11 11:06 被阅读0次

    1.在需要热部署得项目pom中加入依赖

    <dependency>
                groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <scope>runtime</scope>
                <optional>true</optional>
     </dependency>
    

    2.在pom文件中加入build标签

    <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>
    

    3.打开IDEA settings窗口,修改Compiler的配置


    image.png

    这四项要打勾

    1. 按 ctrl+shift+alt+/


      image.png

    选第一个,然后找到下列两项打勾


    image.png
    image.png

    5.重启IDEA

    相关文章

      网友评论

          本文标题:spring 项目开启热部署

          本文链接:https://www.haomeiwen.com/subject/xpqjgktx.html