How to solve Maven Invoker API warning: Maven will be executed in interactive mode, but no input stream has been configured

Viewed 1370

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 Answers

Just set an empty InputStream

InvocationRequest invocationRequest = new DefaultInvocationRequest();
invocationRequest.setInputStream(InputStream.nullInputStream());
...
Related