问题
I have a plugin which invokes Maven runs using MavenInvokerAPI. Everything is working fine, but I do have this warning in my Maven console output.
[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
I do not need interaction in my build process, and based on Javadoc of setInputStream()
, I set my inputStream
to null
, but again I have this warning:
/**
* Sets the input stream used to provide input for the invoked Maven build. This is in particular useful when
* invoking Maven in interactive mode.
*
* @param inputStream The input stream used to provide input for the invoked Maven build, may be <code>null</code>
* if not required.
* @return This invoker instance.
*/
Invoker setInputStream( InputStream inputStream );
How can I solve this? Or maybe hide the warning from console?
回答1:
Just set an empty InputStream
InvocationRequest invocationRequest = new DefaultInvocationRequest();
invocationRequest.setInputStream(InputStream.nullInputStream());
...
来源:https://stackoverflow.com/questions/60637697/how-to-solve-maven-invoker-api-warning-maven-will-be-executed-in-interactive-mo