gradle/gradlew构建时出现异常。没有测试用例的构建成功。当我将gradle更新到6.0.1时出现这种情况
适用于Gradle 5.6/6.2版本。
Could not write standard input to Gradle Test Executor 2.
java.io.IOException: The pipe is being closed
at java.base/java.io.FileOutputStream.writeBytes(Native Method)
at java.base/java.io.FileOutputStream.write(FileOutputStream.java:348)
at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:68)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:835)
Error: Could not find or load main class worker.org.gradle.process.internal.worker.GradleWorkerMain
Caused by: java.lang.ClassNotFoundException: worker.org.gradle.process.internal.worker.GradleWorkerMain
FAILURE: Build failed with an exception.
3条答案
按热度按时间qxsslcnc1#
我刚刚遇到了这种情况,发现停止gradle守护进程为我解决了这个问题:
或
这取决于您的设置(当您尝试再次构建时,守护进程将重新启动)。
inb24sb22#
我遇到了这个错误,我找到的一个方法是转储整个
$HOME/.gradle
缓存,然后重建项目。启动/停止IntellijIDEA和/或重建没有帮助。
当运行低级的测试用例由于不明确的原因而开始失败时,您知道您已经跳过了复杂性的鲨鱼。
当然,这是在机器崩溃后发生的。但仍然...
omjgkv6w3#
如果是Windows系统,请尝试从用户目录中删除.gradle文件夹,然后尝试构建gradle。