Spring Devtools triggers restart when changing excluded files

2.1k views Asked by At

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
2

There are 2 answers

0
morecore On BEST ANSWER

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.

0
tibi On

My exclude also did not work. What I did as a workaround is slowing the reload down like this:

  poll-interval: 6000
  quiet-period: 5000