Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell Gradle to use --console=plain all the time?

Tags:

gradle

build

I am using gradle from a slightly unorthodox terminal, so Gradle's traditional "pretty" output does not work.

Is there a way I can specify in ~/.gradle/gradle.properties that --console=plain should be used for every gradle command?

like image 935
Lee H Avatar asked Dec 10 '15 22:12

Lee H


People also ask

How do I run a default task in Gradle?

In the list that opens, select Run Gradle task. In the Select Gradle Task dialog, specify the project and the task that you want to execute before launching the project. You can specify a Gradle linked project or any other Gradle project.

How do I run a clean build in gradlew?

To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: On Windows: gradlew <task1> <task2> … ​ e.g. gradlew clean allTests.

How do I set system properties in Gradle?

System properties Using the -D command-line option, you can pass a system property to the JVM which runs Gradle. The -D option of the gradle command has the same effect as the -D option of the java command. You can also set system properties in gradle. properties files with the prefix systemProp.


1 Answers

Since Gradle 4.3 you can add a line to a file called gradle.properties in your project's root directory:

org.gradle.console=plain

If you really need to make this system-wide (not just project-wide), you could make an alias for your gradle command, i.e on Linux:

alias gradle='gradle --console=plain'
like image 103
Mikk Avatar answered Oct 07 '22 01:10

Mikk