void () { if (SystemInfo.isWindows && isGradleOlderThan("3.5")) { Path gradleUserHome = getGradleUserHome(); Path cacheFile = gradleUserHome.resolve("caches/jars-1/cache.properties"); if (Files.notExists(cacheFile)) { try { Files.createFile(NioFiles.createParentDirectories(cacheFile)); } catch (IOException e) { throw new UncheckedIOException(e); } } Path scriptsCacheFolder = gradleUserHome.resolve("caches").resolve(gradleVersion).resolve("scripts"); try { NioFiles.deleteRecursively(scriptsCacheFolder); LOG.debug("Gradle scripts cache folder has been successfully removed at " + scriptsCacheFolder); } catch (IOException e) { LOG.debug("Gradle scripts cache folder has not been removed at " + scriptsCacheFolder); } Path scriptsRemappedCacheFolder = gradleUserHome.resolve("caches").resolve(gradleVersion).resolve("scripts-remapped"); try { NioFiles.deleteRecursively(scriptsRemappedCacheFolder); LOG.debug("Gradle scripts-remapped cache folder has been successfully removed at " + scriptsRemappedCacheFolder); } catch (IOException e) { LOG.debug("Gradle scripts-remapped cache folder has not been removed at " + scriptsRemappedCacheFolder); } } }