How can I make “gradle –stacktrace” the default?

Not in gradle.properties but in build.gradle itself. Add the following piece of code at the very beginning of the build script: import org.gradle.logging.ShowStacktrace gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS throw new RuntimeException(‘lol’) Or in Android Studio: import org.gradle.api.logging.configuration.ShowStacktrace gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS It also might be put in init script. As pointed out in the comments, from gradle v. … Read more

What is the gradle equivalent of maven’s exec plugin for running Java apps?

The easiest solution is to use the Application Plugin, which among other things provides a run task. To make the main class configurable from the command line, you’ll have to set mainClassName to the value of some system (or project) property, and then pass that property from the command line: apply plugin: “application” mainClassName = … Read more

tech