springmavenspring-bootreloadspring-boot-devtools

Spring-Boot-Devtools doesn't want to reload process (doesn't pick up proper classpaths?)


I have a small Spring Boot project (from spring-boot-starter). Everything configured, i want to use Spring-Boot-Devtools for automatic reloading. When i launch my project (mvn spring-boot:run -X) from my git repo working dir, i can see:

maven logs:

DEBUG] Classpath for forked process: C:\Users\razor\git\spring-boot-starter\target\classes;........

that's ok, path looks good. and then app logs:

2016-09-21 23:47:59.568 DEBUG 13528 --- [ restartedMain] .b.l.ClasspathLoggingApplicationListener : Application started with classpath: []

classpath empty? probably that's the problem that Devtools doesn't want to automatically reload my app. But why ?

When i copy project folder (no other alterations !!!) to other place, reloading works !

Maven (mvn spring-boot:run -X) :

[DEBUG] Classpath for forked process: C:\Java\workspace_rentit\spring-boot-starter2\target\classes;.....

and later:

2016-09-21 23:40:34.224 DEBUG 4060 --- [ restartedMain] .b.l.ClasspathLoggingApplicationListener : Application started with classpath [file:/C:/Java/workspace_rentit/spring-boot-starter2/target/classes/]

Why are there differences? What's wrong ? in second case, reloading works.


Solution

  • Ok, after fiddling with a project for a few more minutes, i've found that probably the problem is the project folder name 'spring-boot-starter' (default project name from eclipse spring boot creator?) that's why reloading in different folder worked (project folder name was different too), after changing project folder name under my git repo, reloading started to work again.

    Is it documented 'feature' ? :)

    looks like project's DIRECTORY shouldn't be named 'spring-boot-....' (it's not connected with artifact name or eclipse project name)