{

Learn free gradle tutorials


Difference between gradle and maven build tools

January 14, 2023 ·  2 min read

In this tutorial, Compare maven with gradle and the difference between these two tools. Gradle is an open-source build automation tool for building Java and android projects. It uses the configuration in domain-specific language with groovy or kotlin syntax. Gradle configuration is conventional syntax in files are defined as build.gradle for groovy script build.gradle.kts for kotlin script Gradle performance is a good and simple configuration to build projects in the web and mobile applications....


Difference between using gradlew and gradle

January 14, 2023 ·  3 min read

Gradle tasks are run with either the gradle or gradlew commands. Gradlew is a gradle wrapper for the gradle command. This tutorial talks about the difference between gradlew and gradle command. What you can do with Gradle command? if your machine has a gradle installation, Then the gradle command works as seen below. It gives Gradle version installed on a local machine. C:\>gradle > Task :help Welcome to Gradle 6.0.1. To run a build, run Gradle <task> ....


Different ways to configure java or JDK version in Gradle project

January 14, 2023 ·  3 min read

This tutorial talks about different ways of configuring the java version in Gradle projects. In java projects, Source projects are compiled and generated class files. In Gradle, For the java plugin, We need to provide the java version in build Gradle for compiling and generating class files. Java installation is required for building the Gradle project and running the Gradle build. How to configure source and target JDK version in gradle build to compile files in java, we use the javac command and which has source and target arguments for the javac command....


Different ways to pass command line arguments to Gradle command task

January 14, 2023 ·  2 min read

You learned how to pass command-line arguments from the Gradle build script. In Gradle, We can pass parameters below types of parameters. Project properties using -P option java system properties using -D option args option with application plugin How to pass project command-line properties with Gradle script Project properties pass with the -P option from the Gradle command. In build.gradle, task run has configured to read arguments with project.hasProperty task run { if ( project....


Fix for permission denied error for gradlew command

January 14, 2023 ·  2 min read

It is a short tutorial on how to fix a gradlew permission denied error. When you run the gradlew command with any task, You got the following error in windows as well as Linux. $ ./gradlew compile -bash: ./gradlew: Permission denied gradlew: Permission denied is a permission error on a Linux or Unix machine, So you have to change permissions for the gradlew wrapper command. First, check available permissions for the file using the below command....


Frequently used Gradle commands list | Gradle cheat sheet

January 14, 2023 ·  4 min read

Gradle is a build automation tool for java and android projects. A developer working on java projects knows about Gradle command use. This tutorial covers list of commands used by the developer for daily usage in projects Please have a look at my previous article maven installation. For the maven installation, the JDK is required. You can use either gradle wrapper command gradlew or [installs gradle] (/gradle-installation> locally for gradle command execution...


gitignore file for Gradle java and android project

January 14, 2023 ·  2 min read

Gradle is a Java project build tool that allows you to compile, build, manage dependencies, and deploy your projects. It also creates jar/war/ear files for various web and Android applications. The java Gradle project includes XML, java, and JSP source code that commits to svn and git repositories. Gitignore is a file that includes a list of files or directories that ignores when committing to remote repositories in Java projects....


How to create a release signed apk file using Gradle?

January 14, 2023 ·  2 min read

Once your android application is ready, You need to generate apk with a sign. This tutorial talks about how to generate a release apk file using the Gradle file. How to generate release unsigned apk file using Gradle? During development, You need to test your application on real devices, you need to generate an unsigned apk file. Here is a sequence of steps to generate an unsigned apk release In the build....


How to exclude dependency in Gradle projects?

January 14, 2023 ·  2 min read

This tutorial talks about how to exclude dependency in Gradle. This post also includes excluding jar files in groovy and kotlin scripts. Gradle uses two different version syntaxes for configuring build dependencies groovy kotlin How to exclude transitive dependencies in Gradle? This section talks about excluding runtime and compile time for each dependency. exclude runtime dependency: Sometimes, You have transitive dependencies which are causing conflict with the version of the direct dependency....


How to force Gradle to redownload dependencies?

January 14, 2023 ·  2 min read

Sometimes We want to redownload dependencies in a Gradle project. How can you force grade dependencies to download freshly? This post describes how to do the command line to force snapshots and release dependencies in a Gradle project. In development, We have many use cases where we have to redownload dependencies. when you are doing Gradle build the first time, It downloads all dependencies For suppose, the build fails and some dependencies are not downloaded due to network issues....


How to install and configure Gradle in windows,linux ?

January 14, 2023 ·  2 min read

This tutorial explains a step-by-step tutorial on how to install and set up the below environments. windows Linux Mac OS Gradle is a Java and Android project build automation tool. More projects are adopting this tool during development now that Android Studio supports integration with Gradle. Gradle requires Java to be installed. It needs JDK version 8 at least. First, check whether Java is installed or not using the below command....


How to perform git tasks with build script?

January 14, 2023 ·  3 min read

In these tutorials, Learn how to perform the below git operations in the build script. Clone git repository in gradle build git pull changes from the Gradle task create a git tag and commit changes to the remote repository. Sometimes, We have to write a build script to automate git tasks for the build process in continuous integration and build deployment, These build scripts are configured as dependent plugins in the life cycle of the Gradle build cycle or can run as an individual....


How to print dependency tree graph in Gradle projects

January 14, 2023 ·  17 min read

Gradle is a project build tool for java and android applications. Contents What is Gradle dependency tree? How do you read a Gradle dependency tree? How to print dependency tree in Gradle projects? Print dependencies for sub-modules in multi-project Gradle project Generate Dependency tree in HTML report Conclusion When you are using Gradle in your project, added dependencies in the Gradle file. Once the dependencies have been configured, they will be downloaded from repositories to your local machine....


How to run only single test cases with Gradle build

January 14, 2023 ·  2 min read

It is a short tutorial on how to run single test case execution in gradle build Single module project Multi modular project times, to debug test case execution, We need to run single test cases multiple times, thus helping developers to debug and run multiple times without wasting time. Test cases can be unit or integration or functional tests. How to run single test cases in the Gradle project? Suppose you have tested the EmployeeTest java class located in the com....


Learn Gradle | tutorials, and examples

January 14, 2023 ·  3 min read

What is Gradle? Gradle is an Opensource build automation tool to build and run projects in Android and java based on projects. Features: Incremental builds Gradle considers the last modified files and the last build and only builds with modified files thus improving performance. Parallel task execution Build caching JVM and Android application management Gradle version The current version is 7.1. Gradle Download The Gradle tool can be downloaded from here....


Ways to skip test case execution in Gradle project build

January 14, 2023 ·  3 min read

With Gradle build or run command, executes test case execution by default. Sometimes, We want to disable or ignore test execution in Gradle project execution. In Maven, you can easily do this with the command line with the option -DskipTests=true. This blog talks about different ways to disable test case execution in Gradle projects. It skips the following test cases. Unit test cases Integration test is -DskipTests available with Gradle command?...


Android Gradle command line list examples

March 9, 2022 ·  2 min read

This tutorial talks about gradle commands used in android applications. You can do the same tasks using android studio. Knowing commands is helpful for mobile developers to get confidence in app build and deployment. How to list tasks from the command line in the android application The Gradle wrapper provides a task command to list out all available tasks in the Android app. In windows, Please run the following command...


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