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.
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.
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.
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.