Link

Gradle and Maven

Table of contents

  1. Advantages of Gradle over Maven
  2. Install Gradle
  3. Recommended reading

Gradle and Maven are build automation tools that are designed to be flexible enough to build almost any type of software, ranging from mobile application to web applications and command line applications.

  1. Gradle (https://gradle.org/)
  2. Maven (http://maven.apache.org/)

According to Google Trends, Maven is the most popular build tool.

Popularity

Advantages of Gradle over Maven

  1. Flexible

    Changing the build lifecycle using Maven is harder than expected. Gradle addressed this and made it easy to customise the lifecycles as required (reference).

  2. Performant

    Performance
    (Reference)

  3. Better Dependency Management

    Maven allows one to override a dependency, but only by their version. Gradle provides customizable dependency selection and substitution rules that can be declared once and handle unwanted dependencies project-wide. This substitution mechanism enables Gradle to build multiple source projects together to create composite builds (reference).

Install Gradle

  1. Install

    Either using SDKMAN

    $ sdk install gradle 6.3
    

    or using brew

    $ brew install gradle
    
  2. Verify

    ```bash $ gradle -version


Gradle 6.3 ————————————————————

Build time: 2020-03-24 19:52:07 UTC Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin: 1.3.70 Groovy: 2.5.10 Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019 JVM: 14.0.1 (AdoptOpenJDK 14.0.1+7) OS: Mac OS X 10.15.4 x86_64 ```

For more details, please refer to: https://gradle.org/install/.

  1. Gradle in Action (O’Reilly Books)
  2. Gradle Beyond the Basics (O’Reilly Books)
  3. Building and Testing with Gradle (O’Reilly Books)
  4. Gradle Fundamentals (O’Reilly Video Series)