zoukankan      html  css  js  c++  java
  • IDEA中Spring boot配置热部署无效问题解决方式(转)

    IDEA中Spring boot配置热部署无效问题解决方式

    该配置方式属于通过配置devtools实现热部署

    只要在pom文件中添加下面代码段即可

    <!-- 热部署 -->
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-devtools</artifactId>
          <optional>true</optional>
          <scope>true</scope>
        </dependency>
    
    ----------------------------------------------------
    
    
    <build>
        <plugins>
          <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
              <!-- 没有该配置,devtools 不生效 -->
              <fork>true</fork>
              <addResources>true</addResources>
            </configuration>
          </plugin>
        </plugins>
      </build>

    但是配置好无效,下面需要修改idea中的两个配置

    1. setting –> compiler
      将 Build project automatically 勾选上
    2. alt + shift + a 搜索 registry 选第一个,弹出框后下拉找到 compiler.automake.allow.when.app.running 勾选上即可。

    热部署无效问题已解决。

  • 相关阅读:
    C#中枚举的使用
    04 Spring的依赖注入
    03 Spring对Bean的管理
    02 Spring IOC
    01-Spring概述
    java8-方法引用
    java8-Stream
    java8-lambda
    centos中执行apt-get命令提示apt-get command not found
    Eclipse里git提交冲突rejected – non-fast-forward
  • 原文地址:https://www.cnblogs.com/yasepix/p/9015774.html
Copyright © 2011-2022 走看看