6

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?

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
frdsprtrdr
  • 384
  • 1
  • 2
  • 11
  • 1
    This other question may help if you want to hide the warning: https://stackoverflow.com/questions/4782089/how-to-change-maven-logging-level-to-display-only-warning-and-errors or https://stackoverflow.com/questions/32682374/how-to-disable-specific-warning-during-maven-execution – MrsNickalo Mar 11 '20 at 14:03
  • does not solve the problem, because even using -q I have the warnings – frdsprtrdr Mar 12 '20 at 10:32

1 Answers1

4

Just set an empty InputStream

InvocationRequest invocationRequest = new DefaultInvocationRequest();
invocationRequest.setInputStream(InputStream.nullInputStream());
...
abosancic
  • 1,776
  • 1
  • 15
  • 21