Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Gradle and Maven? [closed]

Tags:

maven

gradle

What is the difference between Gradle and Maven?

I am new to Gradle but I used to work with maven.

When to use Gradle and When to use Maven ?

like image 968
Veera Avatar asked Aug 06 '13 05:08

Veera


People also ask

What is the difference between Gradle and Maven?

Gradle is based on a graph of task dependencies – in which tasks are the things that do the work – while Maven is based on a fixed and linear model of phases. With Maven, goals are attached to project phases, and goals serve a similar function to Gradle's tasks, being the “things that do the work.”

Which is better Gradle or Maven?

The biggest differences are Gradle's mechanisms for work avoidance and incrementality. The top 3 features that make Gradle much faster than Maven are: Incrementality — Gradle avoids work by tracking input and output of tasks and only running what is necessary, and only processing files that changed when possible.

Which is faster Maven or Gradle?

Gradle is between 7 and 85 times faster than Maven when building incremental changes; benefits increase with number of subprojects. Gradle builds are 3 to 30 times faster than Maven builds when task outputs can be resolved Gradle's build cache.

Can we have both Maven and Gradle together?

Short answer: yes. There's no conflict between having two independent build scripts for the same project, one in Maven and one in Gradle.


2 Answers

You can think of Gradle as goodness of Ant and Maven put together minus the noise of XML. And scriptability with groovy is very big plus.

  • Gradle gives you conventions but still gives you power to override them easily.
  • Gradle build files are less verbose as they are written in groovy.
  • It provides very nice DSL for writing build tasks.
  • Has lot of good plugins and vibrant ecosystem

When to use Gradle and When to use Maven ?

Almost everywhere for creating java/groovy project. The build files are much terse.

With Google choosing Gradle as the new build system for Android SDK and mature libraries like Spring, Hibernate, Grails, Groovy etc. already using it to power their builds, there is no doubt that Gradle is becoming de-facto build system for the Java ecosystem.

like image 190
kdabir Avatar answered Oct 07 '22 15:10

kdabir


Gradle is the next evolutionary step in JVM-based build tools. It draws on lessons learned from established tools like Ant and Maven and takes their best ideas to the next level. Following a build-by-convention approach, Gradle allows for declaratively modeling your problem domain using a powerful and expressive Domain-Specific Language (DSL) implemented in Groovy instead of XML. As Gradle is a JVM native, it allows you to write custom logic in the language you are most comfortable with, be it Java or Groovy

For more information here: Next generation builds with Gradle

like image 23
Xelian Avatar answered Oct 07 '22 16:10

Xelian