gnodet commented on PR #176:
URL: 
https://github.com/apache/maven-integration-testing/pull/176#issuecomment-1175157588

   > > > @gnodet Does 
[8b57597](https://github.com/apache/maven-integration-testing/commit/8b575970d5ace770560d1f6b60fc226fab11e51f)
 find the symptom or the cause? Why does not happen at all now, not before?
   > > 
   > > 
   > > I found out that the error `[SUREFIRE] std/in stream corrupted` is 
caused by the input stream being closed and `plexus-interactivity-api` does 
close the input stream, so I'm trying to work around the problem. I don't 
really know why this happen now and not before though.
   > 
   > Interesting, how is this here involved? What if we supply always batch 
mode?
   
   The `plexus-interactivity-api` is a dependency of several plugins like 
`maven-jar-plugin:2.4`, or `maven-resources-plugin:2.6` and also 
`maven-it-plugin-uses-wagon`.  The `plexus-interactivity-api` defines a 
plexus-component `DefaultInputHandler` which is activated by the plexus 
container started by the `Verifier`. This component creates a console reader on 
top of the `System.in` stream and closes the reader when the component is 
disposed.  This call causes the underlying `System.in` stream to be closed.   
This is problematic when surefire embeds the test (i.e. not forking), because 
surefire does use the standard input stream as a way to communicate with the 
forked JVM.  Hence the error displayed by surefire that the std/in has been 
closed.
   
   In a real scenario, this is usually not a problem.  And also, this has been 
fixed a few months ago by 
https://github.com/codehaus-plexus/plexus-interactivity/commit/58cbbe06afd5ad61b9481180e9228c6e7cea187c,
 so recent plugins won't suffer from this problem.
   
   Anyway, to support tests that do use the old API, we need to wrap the 
`System.in` in a non closeable stream before booting the plexus container.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to