在Windows上使用Gradle构build时如何解决OverlappingFileLockException?

试图浏览使用Gradle的Spring REST教程时 ,在尝试运行./gradlew clean test时,遇到了OverlappingFileLockException。 当我试图使用Gradle的完整安装而不是包含的包装,我会得到相同的exception。 所以,我决定开始更简单,并遵循Gradle自己的Hello World示例 ,结果相同。 这里是堆栈跟踪:

 FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'hello-world'. > Could not open no_buildscript class cache for build file 'D:\gradle-playground\hello-world\build.gradle' (\\omafp01.co rp.planetci.com\ramc01\.gradle\caches\1.11\scripts\build_5trnq1oe4m84o6rmggev8gku4t\ProjectScript\no_buildscript). > java.nio.channels.OverlappingFileLockException (no error message) * Try: Run with --info or --debug option to get more log output. * Exception is: org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'hello-world'. at org.gradle.configuration.project.LifecycleProjectEvaluator.addConfigurationFailure(LifecycleProjectEvaluator. java:79) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:57) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:507) at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:82) at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:31) at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:142) at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:113) at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:81) at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter .java:64) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:33) at org.gradle.launcher.cli.ExecuteBuildAction.run(ExecuteBuildAction.java:24) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:35) at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26) at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:50) at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:171) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:20 1) at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:17 4) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:170) at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:139) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33) at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22) at org.gradle.launcher.Main.doAction(Main.java:46) at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45) at org.gradle.launcher.Main.main(Main.java:37) at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50) at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:32) at org.gradle.launcher.GradleMain.main(GradleMain.java:23) Caused by: org.gradle.cache.CacheOpenException: Could not open no_buildscript class cache for build file 'D:\gradle-play ground\hello-world\build.gradle' (\\omafp01.corp.planetci.com\ramc01\.gradle\caches\1.11\scripts\build_5trnq1oe4m84o6rmg gev8gku4t\ProjectScript\no_buildscript). at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:48) at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:28) at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:81) at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:51) at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.doOpen(DefaultCacheRepository.java:14 1) at org.gradle.cache.internal.DefaultCacheRepository$AbstractCacheBuilder.open(DefaultCacheRepository.java:124) at org.gradle.groovy.scripts.internal.FileCacheBackedScriptClassCompiler.compile(FileCacheBackedScriptClassCompi ler.java:57) at org.gradle.groovy.scripts.internal.ShortCircuitEmptyScriptCompiler.compile(ShortCircuitEmptyScriptCompiler.ja va:35) at org.gradle.groovy.scripts.internal.CachingScriptClassCompiler.compile(CachingScriptClassCompiler.java:36) at org.gradle.groovy.scripts.DefaultScriptCompilerFactory$ScriptCompilerImpl.compile(DefaultScriptCompilerFactor y.java:57) at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:17 1) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38) at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25) at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.j ava:34) at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55) ... 25 more Caused by: java.nio.channels.OverlappingFileLockException at org.gradle.cache.internal.filelock.LockStateAccess.tryLock(LockStateAccess.java:83) at org.gradle.cache.internal.filelock.LockFileAccess.tryLockState(LockFileAccess.java:83) at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lockStateRegion(DefaultFileLockManager.java: 312) at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.lock(DefaultFileLockManager.java:255) at org.gradle.cache.internal.DefaultFileLockManager$DefaultFileLock.<init>(DefaultFileLockManager.java:127) at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:80) at org.gradle.cache.internal.DefaultFileLockManager.lock(DefaultFileLockManager.java:67) at org.gradle.cache.internal.DefaultCacheAccess.open(DefaultCacheAccess.java:86) at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:46) ... 39 more 

这里是build.gradle的内容:

 task hello { doLast { println 'Hello world!' } } 

我正在运行Windows 8,64位JDK(1.6_043)和Gradle 1.11,同时连接到VPN。 当然,这在我的Macbook上工作正常,但我需要得到它在我的工作机器上工作。

Solutions Collecting From Web of "在Windows上使用Gradle构build时如何解决OverlappingFileLockException?"