Gradle commands list | cheat sheet


Gradle is a build automation tool for java and android projects. Developer working on java projects know about gradle command use. This tutorial covers list of commands used by developer for dailu usage in projects

Please have a look of my previous article maven installation. For the maven installation, the JDK is required.

Frequently used Maven commands

Gradle commands list

You can use either gradlew or gradle.bat file for command execution

Compile gradle project

gradlew compile 

It will compile the project java files

list tasks of a gradle build

all tasks can be listed for build file using below command

gradle tasks

It will display all tasks related the build file in a project

Running spring boot project with gradle

In spring boot project, once gradle plugin is configured, Application is build using below command

gradle build

How do you make jar file for spring boot application

gradle bootJar

Here is the command for creating war file for the same

gradle bootWar

Spring boot application can be started using bootRun command

gradle bootRun

This will compile, copy and run the spring boot server, It is not required to build and compile the application.

THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
Subscribe
You'll get a notification every time a post gets published here.