• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Build tools comparison

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am looking to start a new project (web application in Java/J2EE using Spring). I am looking for build tools which are available. I have heard about Maven and Gradle, providing more features compared to Ant like
  • dependency Management,
  • project structure,
  • convention over configuration,
  • versioning
  • But still not able to find out the best tool that can be used. I have gone through lots of discussion, all are saying Gradle is better compared to Maven, but the articles were published in 2009, I have not found out the new article comparing the features of both Gradle and Maven.
    Please suggest the best build tool.


    Amit Arora
    (SCJP, SCWCD)
     
    Greenhorn
    Posts: 21
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hello,

    I've been using Maven for several years in different enterprise projects and could recommend it to you. I do not have any experiences with Gradle, so could not tell you which one is better.
    However I can assure you that if you choose Maven, you will not be disappointed. You can quickly configure your continuous build environment using Maven together with Nexus and Hudson.
    All of them are great products easily installed and maintained.
    There is also another nice feature of Maven: plugins written in Java. There are lot of thems: for example for managing dependencies, starting application server, sql operations.
    If is not enough, you can always write your own plugin, which is easy and well documented.

    And one more thing, as I can see on Gradle site, the last version is 1.0-milestone-3.
    In case of Maven the last version is 3.03, You can also choose version 2.2.1 (I'm currently using it).
    If you start a commercial project using stable version is a must IMO.

    I hope this will help you making your decision
     
    Amit Arora
    Ranch Hand
    Posts: 30
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks for reply Pawel. I have heard that pom.xml becomes too complex if your project size is getting bigger, moreover you cannot go for scripting in pom.xml (which you may need at some time) and the maven is rigid. All these problems are addressed in Gradle which is groovy based.
     
    Pawel Piwowar
    Greenhorn
    Posts: 21
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    You can modularise your project with parent and child modules. Each module can be a parent for another modules as well. This way you don't have to put everything into single pom.xml.
    Another approach is dividing your big project into smaller independent projects. Each of them producing its own artifacts (jar for example) placed in repository. Your main project becomes smaller and simpler, using artifacts already present in repository. Its not only a remedy for complex poms, but also for making your application easy to maintain. In case of Gradle build I would recommend similar approach.

    Concerning scripting, do you really need it ? For typical tasks like unpacking dependencies or creating EARs, you can use plugins (http://maven.apache.org/plugins/index.html) . Which is simpler and more reliable then creating your own scripts. Or you can create his own plugin in Java, which give you more flexibility and control (JUnit tests for your plugins) then writing scripts.
    However if you insist to write scripts in groovy, you can also do it, by using groovy-maven-plugin.
     
    Ranch Hand
    Posts: 318
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    if you find maven learning curve too steep

    you could use ANT with ivy
     
    Rancher
    Posts: 2759
    32
    Eclipse IDE Spring Tomcat Server
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I wasn't aware of Gradle until this post, and I looked it up and it seems to me like it's Ant+Ivy in Groovy. It's great if Ant is your cup of tea

    However, personally, after using Maven, I stay away from Ant as far as possible. Ant has tremendous flexibility over Maven, but IMO, that is a short coming of Ant.It's fine for small projects/one-man-two-man shop, but when you are trying to build multiple products with multiple modules each, Ant's flexibility tends to start working against it. There are too many things that you can do wrong with Ant, and generally, developers end up doing it wrong. The thing is doing things the "right way" in ant requires some thought. You need to start thinking about the "design" of your build scripts. However, in most teams where developers write build scripts, the build script is an afterthought. Developers are and should be focused on writing good production code, not on writing good build scripts

    Maven, OTH, being rigid doesn't allow you to mess up as bad as Ant does. All your developers need to worry about is a) which plugin to use, b) which phase to bind the plugin to, c) which dependencies to add to the project. I think the only point where you need to be worried about in a large project is conflicting dependencies, and there are some good practices that you can follow.
     
    clojure forum advocate
    Posts: 3479
    Mac Objective C Clojure
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    If you are in mood of evaluating other options, Apache Buildr looks promising and potential.
     
    She'll be back. I'm just gonna wait here. With this tiny ad:
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic