gpt4 book ai didi

java - 如何解决 Maven Invoker API 警告 : Maven will be executed in interactive mode, 但没有配置输入流

转载 作者:行者123 更新时间:2023-12-03 19:15:55 24 4
gpt4 key购买 nike

我有一个使用 MavenInvokerAPI 调用 Maven 运行的插件。一切正常,但我的 Maven 控制台输出中确实有此警告。

[WARN] Maven will be executed in interactive mode, but no input stream has been configured for this MavenInvoker instance.
我在构建过程中不需要交互,并且基于 setInputStream() 的 Javadoc ,我设置了我的 inputStreamnull ,但我再次收到此警告:
   /**
* 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 );
我该如何解决这个问题?或者可能隐藏控制台的警告?

最佳答案

只需设置一个空的 InputStream

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

关于java - 如何解决 Maven Invoker API 警告 : Maven will be executed in interactive mode, 但没有配置输入流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60637697/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com