Spring-boot: StackTrace with Spring DevTools and Maven clean command

Created on 13 Oct 2016  路  5Comments  路  Source: spring-projects/spring-boot

Hi,

When I start my project all is OK. But if I use mvn clean command, I get this StackTrace:

Exception in thread "File Watcher" java.lang.IllegalArgumentException: Folder must not be a file
at org.springframework.util.Assert.isTrue(Assert.java:68)
at org.springframework.boot.devtools.filewatch.FolderSnapshot.(FolderSnapshot.java:55)
at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.getCurrentSnapshots(FileSystemWatcher.java:281)
at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.scan(FileSystemWatcher.java:254)
at org.springframework.boot.devtools.filewatch.FileSystemWatcher$Watcher.run(FileSystemWatcher.java:239)
at java.lang.Thread.run(Thread.java:745)

My environment is:

  • IntelliJ: 2016.2.4
  • Spring Boot: 1.4.1 (with spring-boot-devtools)
  • Maven: 3

Best regards,
Christophe

invalid

Most helpful comment

Are you running mvn clean while the application is running?

All 5 comments

Are you running mvn clean while the application is running?

Yes. I run this command when my application is running.

Thanks. That's the problem, then. mvn clean deletes all your application's classes removing the directory that Dev Tools is monitoring. Rather than using Maven to build your application when using Dev Tools, you should rely on your IDEs support for compiling your project. For example, you should triggers IDEA's Make Project. See http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#using-boot-devtools-restart for more details.

Ok. Thank you for your reply.

Thanks.@wilkinsona, you saved my day!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dsyer picture dsyer  路  40Comments

philwebb picture philwebb  路  45Comments

checketts picture checketts  路  35Comments

ganeshkrishnan1 picture ganeshkrishnan1  路  63Comments

igormukhin picture igormukhin  路  55Comments