关于springboot的启动方式和热部署情况

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zmemorys/article/details/84564759

1.通过spingboot启动类启动 不能自动加载修改静态文件问题

yml中添加以下
devtools:
    restart:
    #热部署生效
    enabled: true
    #设置重启的目录
    additional-paths: resources/**,static/**,templates/**
    #该目录下的内容修改不重启
    exclude: com/**
thymeleaf:
  cache: false

pom文件添加以下:

<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>
      </plugin>
   </plugins>
</build>

shift+ctrl+alt+/(我猜的,不敢保证,自己试一下),会弹出这个界面:

就选第一个,Resgistry

往下翻,找到这一条,打上勾,关闭

打开设置

到目前为止就可以了

猜你喜欢

转载自blog.csdn.net/zmemorys/article/details/84564759