For some reason, now that Android is moving to a Gradle based build system, there’s some discussion whether Maven is better than Gradle or vice versa. There’s what I like most from Gradle compared to Maven:
1. Fast builds. Run a build twice: 2nd time you’ll see only “UP-TO-DATE” if nothing changed.
2. Dependencies choice: Artifacts in a maven repo? Have a library as a jar in your project? No problem, you can mix and match. A big improvement IMHO over the “everything has to be in a repo” approach that Maven has. Don’t make me maven install things or force me to have a repository manager. It doesn’t always make sense to have one.
3. Flexible configuration. For example: if you have some common configuration that you’d like to do in every build file, you can easily create a script for it and include it. Another example: in a multi project setup, you can configure a project from the top level build file, which is very convenient if you are including third party code without a build.gradle through a subrepository / submodule.
4. No more heaps of XML.
5. Gradle wrapper. Just checkout the project, and run gradlew to build the project.
2. Dependencies choice: Artifacts in a maven repo? Have a library as a jar in your project? No problem, you can mix and match. A big improvement IMHO over the “everything has to be in a repo” approach that Maven has. Don’t make me maven install things or force me to have a repository manager. It doesn’t always make sense to have one.
3. Flexible configuration. For example: if you have some common configuration that you’d like to do in every build file, you can easily create a script for it and include it. Another example: in a multi project setup, you can configure a project from the top level build file, which is very convenient if you are including third party code without a build.gradle through a subrepository / submodule.
4. No more heaps of XML.
5. Gradle wrapper. Just checkout the project, and run gradlew to build the project.