java - Spring-Boot:DevTools 不刷新文件
问题描述
我使用 STS 构建网络服务器。
我用这段代码将依赖项放在 pom.xml 中
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.0.5.RELEASE</version>
<optional>true</optional>
<scope>runtime</scope>
</dependency>
当我使用 IDE(Spring Tool Suite)运行我的网络服务器时,如果浏览器上显示的“html”文件发生更改,它会自动应用更改。
但如果我将它作为独立运行('mvnw spring-boot:run')它不起作用。
我该如何解决这个问题?
目前使用 Springframework.boot 2.0.4.RELEASE
解决方案
在 application.properties 集中:
spring.devtools.restart.exclude=
默认值是(也许你的 html 文件在这里):
spring.devtools.restart.exclude=META-INF/maven/**,META-INF/resources/**,resources/**,static/**,public/**,templates/**,**/*Test.class,**/*Tests.class,git.properties
推荐阅读
- scala - IntelliJ IDEA 无法解析 build.sbt 并且不存在 sbt 工具窗口
- elasticsearch - 映射附件在 Elasticsearch 7.7 中引发错误
- flutter - NoSuchMethodError (NoSuchMethodError: 方法 'add' 在 null 上被调用
- django - Django:同时保存两个不同的表单会在数据库中产生两个条目
- python - 正则表达式最小匹配
- ios - 即使已经安装了应用程序,分支深度链接也会打开 Appstore 而不是 App
- angular - 模块“AppModule”声明的意外值“ViewPlayerPagePageModule”。在离子
- python - pandas - 根据固定时间间隔合并行和小计
- typescript - 在 Typescript 中使用不同的返回类型覆盖方法而无需 hack
- c# - ItemsControl 中的元素不会更新,但在 ListBox 中它们会更新