← Back to team overview

dhis2-devs team mailing list archive

Maven vs Gradle

 

For a quick Friday reading:

Interesting comparison of Maven with a new tool, Gradle (I'm not suggesting
a switch, we certainly have many more pressing tasks)

Knut

---------- Forwarded message ----------
From: Zabil C.M <zabilcm@xxxxxxxxx>
Date: Thu, Feb 4, 2010 at 6:32 AM
Subject: [OPENMRS-DEV] Maven vs Gradle.
To: openmrs-devel-l@xxxxxxxxxxxxxxxxxx


Hi All,
 Over this week (along with the earlier maven) I was able to integrate a
relatively new system gradle (http://gradle.org) as well.
 Integrating gradle did not prove out to be tough because gradle understands
the maven (or standard) directory layout.
 The build files for both maven and gradle and available at the git hub
repository

  http://github.com/zabil/openmrs

  Please note there are some dependencies still missing from the gradle
files so test cases don't run successfully. Compilation and packaging works.
you can give gradle a spin by
  $ gradle compile -Dskip.test

  Here are some points we should consider.

  Maven pros
  * Lots of third party plugins for tasks
  * Fairly robust IDE support (eclipse, netbeans, intellij)
  * Dependency management
  * Jetty plugin (you can run the web app off the compiled source with hot
deployment)

 Maven cons
 * XML based configuration. which usually ends up being very verbose.
 * Writing simple and custom tasks (for instance copy a set of files
somewhere) is tedious.
   You have to write a plugin and testing + development  time for simple
tasks may end up too long and time consuming.
   For things to go smooth you usually will have to follow maven conventions
and standard plugins.
 * Everything is a plugin. Even simple tasks like compile and running
tests.
   So for a fresh project, downloading all the plugins takes considerable
time.
   Plus there might be updates to the plugin which will be downloaded
occasionally when you run the build.
 * Lots of maven plugins usually have problems and a general opinion is that
it is hard to debug.
 * Building is slow compared to ant and gradle
 * Does not prepare the html unit test case report by default (but something
called a surefire reports)

 Gradle (pros)
 * Based on groovy. Scripting tasks are quite coz it is in a programming
language.
 * Uses ivy dependency management (which uses maven repositories).
Dependency downloads are quite fast.
 * Integrates ant tasks also.
 * Supports the standard directory layout.
   So for compilation, testing and packaging no extra tasks need to be
written as long    the files are in the layout.
 * Come bundles with a default set of plugins which are core to gradle. So
it does not have to download/update plugins
 * Builds are quite fast.
 * Standard junit reports
 * Supports jetty server

  Gradle (cons)
 * IDE support or the lack of it. Eclipse does not come with good support
for gradle or groovy.
   Intellij idea and netbeans supports it (idea supports gradle projects)
however.
 * Third party plugin support is not as good as maven

 On the whole gradle looks better. If we were to carry out the migrations
gradle will prove easier to migrate the current ant tasks, while we have to
write plugins for maven to get things working.

Cheers,
Zabil
------------------------------
Click here to unsubscribe<LISTSERV@xxxxxxxxxxxxxxxxxx?body=SIGNOFF%20openmrs-devel-l>from
OpenMRS Developers' mailing list



-- 
Cheers,
Knut Staring