Spring Devtools triggers restart when changing excluded files

怎甘沉沦 提交于 2019-12-02 10:31:17

问题


I have a Spring Boot Web Project that uses Joinfaces and Primefaces. The application extends from SpringBootServletInitializer and also generates a war file.

For development I start my Project (in Eclipse) using RunAs -> Spring Boot App. I've added the spring-boot-devtools dependency as described in the Developer Tools Docu. Everything seems to work, except that changes in a xhtml file also triggers the restart.

I've added the spring.devtools.restart.additional-exclude property in my application.yml to exclude also webapp/**. But this seems to have no effect, because a change still triggers the restart.

spring:
  devtools:
    restart:
      additional-exclude: webapp/**

My Project structure looks like:

src
 -main
  -java
  -resources
  -webapp
   - *.xhtml

But maybe I do not understand how to use the DevTools correct - Starting the application as Spring Boot App might not be the correct usage? Because if I place a file e.g. foo.txt under src/main/resources and update its content the application is also restarted (using the DevTools defaults (which should exclude /resources)).

Using:

  • Eclipse Oxygen.3a Release (4.7.3a)
  • Joinfaces 3.2.1 -> Spring Boot 2.0.2.RELEASE

回答1:


The solution to my main problem might be relatively easy.

I've added the webapp folder as Source Folder in Eclipse. As soon as I've removed the folder from the list of source folders, the reload was no longer triggered when I changed something in the xhtml files.

This answer gave me the idea, that the source folder might be the problem.



来源:https://stackoverflow.com/questions/52587818/spring-devtools-triggers-restart-when-changing-excluded-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!