Stop showing Welcome to Gradle message from output
Asked Answered
D

3

12

I am running gradle commands from command line and I want to show only output. There is an option -q, -quiet which says it will log errors only. After running command I get this crap with output too. How can I stop this ??

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>
Driving answered 10/5, 2016 at 16:6 Comment(5)
What gradle version are you using? I am running 2.12 and the only output I see is stuff our tests write out - none of the Gradle messages. Ran: "./gradlew -q clean build"Galateah
Interesting that I do see the message you are talking about when I just run: "./gradlew -q" without a specified task.Galateah
I am running it with task but still getting same message.Driving
Hmm... I just tried 2.9 and still had the message suppressed. Can you share the actual command line you are running? And when you run it with a task does it run the task?Galateah
I have a task which creates Zip archive of current folder. It works fine i.e creates zipDriving
H
7

In Gradle 7.5 there is a new flag that can be set in gradle.properties

org.gradle.welcome=(never,once)

Controls whether Gradle should print a welcome message. If set to never then the welcome message will be suppressed. If set to once then the message is printed once for each new version of Gradle. Default is once.

https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

You can set this property in several ways. The first one found wins.

  • command line, as set using the -P / --project-prop environment options.

  • gradle.properties in GRADLE_USER_HOME directory.

  • gradle.properties in project root directory.

  • gradle.properties in Gradle installation directory.

So, to suppress this in CI/CD add

org.gradle.welcome=never

to $projectDir/gradle.properties

Hanky answered 25/7, 2022 at 20:10 Comment(0)
E
4

Workaround for this, you can simply run gradle --version first before running your command.

Example:

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

EDIT: Workaround from gradle github issues: https://github.com/gradle/gradle/issues/5213#issuecomment-391976595

Endorsed answered 23/5, 2018 at 8:56 Comment(0)
V
3

This can be configured in file gradle.properties:

systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false
Valkyrie answered 14/12, 2021 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.