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

大兔子大兔子 提交于 2020-08-19 11:21:14

问题


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?


回答1:


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'



回答2:


you can try to add this to your ~/.gradle/init.gradle file

gradle.startParameter.colorOutput = false

this seems to do the trick on my osx terminal.




回答3:


Use org.gradle.console=plain

(Padding because this post-body has to be at least 30 characters long despite the complete and accurate answer taking only 28.)



来源:https://stackoverflow.com/questions/34213075/how-to-tell-gradle-to-use-console-plain-all-the-time

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!