dkorotych / gradle-maven-exec-plugin

Gradle plugin which provides an Maven exec task
Apache License 2.0
57 stars 7 forks source link

Could not read standard output of command 'cmd'. #36

Open FJBDev opened 2 years ago

FJBDev commented 2 years ago

@dkorotych Greetings,

I am getting the below error when I try to execute the 'clean package' maven command. Any ideas why the stream is closed ?

My task:

task 41_RunUIUnittests {

   doLast {

      def buildDir = file('../../build/build.functionaltests')

 println '\tFrom ' + buildDir   

      mavenexec {

         workingDir  buildDir
         goals       'clean', 'package'
      }
   }
}

The error:

> Task :41_RunUIUnittests
---------------------------------------------------------------------------------------
        From C:\Users\toto\git\build\build.functionaltests
Could not read standard output of command 'cmd'.
java.io.IOException: write(91) failed: stream is closed
        at org.apache.commons.io.output.ClosedOutputStream.write(ClosedOutputStream.java:47)
        at java.base/java.io.OutputStream.write(OutputStream.java:157)
        at org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:89)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:67)
        at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
        at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
        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:834)
FJBDev commented 2 years ago

bump. anyone can help ?

FJBDev commented 2 years ago

If that can help, here is a more verbose error message:

java.io.IOException: write(91) failed: stream is closed

    at org.apache.commons.io.output.ClosedOutputStream.write(ClosedOutputStream.java:47)

    at java.base/java.io.OutputStream.write(OutputStream.java:157)

    at org.apache.commons.io.output.ProxyOutputStream.write(ProxyOutputStream.java:89)
> Task :mt_41_RunUIUnittests FAILED
    at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(ExecOutputHandleRunner.java:67)
:mt_41_RunUIUnittests (Thread[Daemon worker,5,main]) completed. Took 16.846 secs.
    at org.gradle.process.internal.streams.ExecOutputHandleRunner.run(ExecOutputHandleRunner.java:53)
    at org.gradle.internal.operations.CurrentBuildOperationPreservingRunnable.run(CurrentBuildOperationPreservingRunnable.java:42)
    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:829)

FAILURE: Build failed with an exception.