Skip to content
BENIBIX Learn

Maven vs Gradle

People think Gradle is just Maven with a new file, and it is not. Maven describes a project in pom.xml and runs a fixed list of steps. A Gradle build file is code, in Kotlin or Groovy, so you can add steps of your own. Gradle also skips work that has not changed. Both can fetch packages from Maven Central.

Development🛠️ Editors & Tools

Apache Maven

A free build tool for Java. One pom.xml file describes the whole project.

Apache Maven is a free build tool for Java projects. The whole project is described in one file called pom.xml. That file lists the packages the project needs, and Maven fetches them. Maven expects a fixed folder layout, with code in src/main/java. It runs a set list of phases, like compile, test and package. The finished jar file lands in the target folder.

Example
Lucy clones a Java project and types mvn package. Maven fetches the packages, runs the tests and puts the jar in target.
Why it matters
Every Maven project looks the same inside. A new person can build any of them with one command.
Full entry
Development🛠️ Editors & Tools

Gradle

A free build tool for Java, Kotlin and Android. Its recipe file is code.

Gradle is a free build tool used most for Java, Kotlin and Android apps. The steps live in a file called build.gradle.kts, written in Kotlin, or build.gradle, written in Groovy. Because the file is code, you can add your own steps. It skips work that has not changed, so later builds are fast. Projects ship a small script called gradlew that fetches the right Gradle version.

Example
Jack builds an Android app. He types ./gradlew build, and Gradle compiles the app, runs the tests and makes the app file.
Why it matters
Android apps are built with it. If you build for Android, you work with Gradle every day.
Full entry

In one line

Apache Maven
A free build tool for Java. One pom.xml file describes the whole project.
Gradle
A free build tool for Java, Kotlin and Android. Its recipe file is code.