从输出中停止显示欢迎使用Gradle消息

时间:2016-05-10 16:06:32

标签: gradle gradle-task

我正在从命令行运行gradle命令,我想只显示输出。有一个选项-q,-quiet表示它只会记录错误。运行命令后,我也得到了带输出的垃圾。我怎么能阻止这个?

Welcome to Gradle 2.11.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

1 个答案:

答案 0 :(得分:3)

解决方法是,您可以在运行命令之前先运行gradle --version

示例:

gradle --version # the welcome message will appear here
gradle -q mycommand # there should be no welcome message anymore

编辑: 来自gradle github问题的解决方法:https://github.com/gradle/gradle/issues/5213#issuecomment-391976595