Few points on Java Build Tools: Ant vs Maven vs Gradle

kapil sharma
2 min readAug 8, 2017

In the beginning there was Make as the only build tool available. Later on it was improved with GNU Make

JVM ecosystem is dominated with three build tools:

  1. Ant with Ivy

2. Maven

3. Gradle

Ant

Ant was the first build tool released in 2000 and was easy to learn. Build scripts format was XML

Drawback of ANT:

  1. XML being hierarchical in nature, is not a good fit for procedural programming approach.
  2. XML tends to become unmanageably big when used with all but very small projects

Maven

Maven was released in 2004. It has improved few of the problem of ANT. Maven continues using XML as the format to write build script, however, structure is diametrically different.

The Most important addition, was the ability to download dependencies over the network(later on adopted by Ant through Ivy)

Drawback of Maven:

  1. Dependencies management does not handle conflicts well between different versions of the same library.
  2. Customization of targets (goals) is hard

Gradle

Gradle was released in 2012. Google adopted Gradle as the default build tool for the Android OS. Gradle does not use XML. Instead, it had its own DSL based on Groovy (one of JVM languages). As a result, Gradle build scripts tend to be much shorter and clearer than those written for Ant or Maven.

Initially, Gradle used Apache Ivy for its dependency management. Later own it moved to its own native dependency resolution engine.

Build script sample:

Ant Build Script Sample
Maven Build Script
Gradle Build Script

--

--