環境
- Eclipse Pleiades 4.7
- Maven 3.3.9 (Eclipse pleiadesに組み込まれていたもの. EMBEDDED)
- Java8
- Spring Boot 1.5.7
問題発生
「Maven Clean」実行すると、以下のエラーが発生しました。
console
1,Conrad Treasury Place,William & George Streets,4001
2017-12-31 21:50:37.227 INFO 16216 --- [ restartedMain] sample.DemoApplication : Started DemoApplication in 3.816 seconds (JVM running for 4.333)
2017-12-31 21:50:44.601 INFO 16216 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-12-31 21:50:44.601 INFO 16216 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2017-12-31 21:50:44.617 INFO 16216 --- [nio-8081-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 16 ms
Exception in thread "File Watcher" java.lang.IllegalArgumentException: Folder must not be a file
at org.springframework.util.Assert.isTrue(Assert.java:92)
at org.springframework.boot.devtools.filewatch.FolderSnapshot.<init>(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:748)
原因
Spring Bootが既に起動している状態で、「Maven Clean」を実行したことが原因でした。
エラーが出るのは当然かな。。。?
解決策
言うまでもなく、Spring Bootを停止してから、「Maven Clean」を実行することです。
参考にしたサイト
-
StackTrace with Spring DevTools and Maven clean command
- 下記のコメントで、Spring Bootが起動していることに気づきました。
-
Are you running mvn clean while the application is running?