Thanks for posting this! We’ve filed GRADLE-2275 to track dependency locking issues with the daemon on Windows and will test the solution we’re developing against the case you’ve raised! We should have a fix soon.
Hi, unfortunately I don’t have the original source that caused this issue. I’ve just tested with another similar project setup and it works in 3.0 so I’m confident this has been fixed.
Gradle 3.1. Not sure if my jars are locked by fileTree as described, but locks are still here. I can not clean the project unless I exorcise the daemon.
actually with gradle-3.1clean is broken for me entirely on windows, with or without daemon.
The affected jar can be deleted manually when no gradle process is running.
C:\Users\n3\Projects\leoz>gradlew.bat --stop
No Gradle daemons are running.
C:\Users\n3\Projects\leoz>gradlew.bat --no-daemon clean
Constructor DefaultSourceDirectorySet(String, FileResolver) has been deprecated and is scheduled to be removed in Gradle 4.0
:buildSrc:syncClasses UP-TO-DATE
:buildSrc:compileKotlin UP-TO-DATE
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy UP-TO-DATE
:buildSrc:processResources UP-TO-DATE
:buildSrc:classes UP-TO-DATE
:buildSrc:jar UP-TO-DATE
:buildSrc:assemble UP-TO-DATE
:buildSrc:compileTestKotlin UP-TO-DATE
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build UP-TO-DATE
:leoz-boot:clean UP-TO-DATE
:leoz-central:clean UP-TO-DATE
:leoz-central-schema:clean UP-TO-DATE
:leoz-node:flywayClean
:leoz-node:jpaClean
:leoz-node:clean
:leoz-ui:clean UP-TO-DATE
:libs:clean UP-TO-DATE
:libs:barbarywatchservice:clean FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':libs:barbarywatchservice:clean'.
> Unable to delete file: C:\Users\n3\Projects\leoz\libs\barbarywatchservice\build\libs\barbarywatchservice-2.0-SNAPSHOT.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 9.115 secs
C:\Users\n3\Projects\leoz>del C:\Users\n3\Projects\leoz\libs\barbarywatchservice\build\libs\barbarywatchservice-2.0-SNAPSHOT.jar
C:\Users\n3\Projects\leoz>