I try to use Spring-boot with Gradle and Kotlin. The restarter monitors build/classes/kotlin/main directory. It works fine when Kotlin classes are updated after changes. But when there is a build failure (due to any error in Kotlin code), Kotlin's Gradle plugin removes build/classes/kotlin/main directory. It is recreated after fixing the error, but the auto-restart feature no longer works. You can reproduce the problem also by manually moving any watched directory for a few seconds to any other location and back.
Unfortunately I don't see any way to configure Kotlin's plugin not to remove this directory on failure and no way to make Spring-boot restarter watch other directory instead (e.g. build/classes).
I'm using Spring-boot 2.0.3, Kotlin 1.2.50 on Linux.