Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop showing Welcome to Gradle message from output

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>
like image 938
mallaudin Avatar asked May 10 '16 16:05

mallaudin


3 Answers

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

like image 115
Ismandra Eka Nugraha Avatar answered Nov 01 '22 07:11

Ismandra Eka Nugraha


This can be configured in file gradle.properties:

systemProp.org.gradle.internal.launcher.welcomeMessageEnabled=false
like image 30
Martin Zeitler Avatar answered Nov 01 '22 07:11

Martin Zeitler


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

like image 2
aSemy Avatar answered Nov 01 '22 06:11

aSemy