Project to learn and explore the gradle build automation tool.

Each subdirectory contains an example

Gradle Daemon

Dramatically speeds up tasks. See Gradle Daemon docs.


Can enable view the following

touch ~/.gradle/ && echo "org.gradle.daemon=true" >> ~/.gradle/


Show Tasks

gradle tasks


This is a simple example showing how to run a task and print to stdout.

To Run

$ gradle helloworld


Init gradle

$ mkdir command-line-app
$ cd command-line-app
$ gradle init --type java-library

This creates the gradle files and default directory structure for a java-library

Create a jar

$ gradle uploadArchives

outputs jar to repos/

Run via

$ java -cp repos/command-line-app-1.0.jar Main


$ java -jar repos/command-line-app-1.0.jar

The application plugin enables you to run the app via gradle run. You need to add the following to build.gradle.

apply plugin: 'application'
mainClassName = 'Main'