Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler.

Similar presentations


Presentation on theme: "Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler."— Presentation transcript:

1 Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler

2 Java Build Tool Comparison Desired Features The Contenders Ant + Ivy Maven Gradle Buildr Others Results Matrix Subjective Evaluation Which Would You Choose?

3 Desired Features Dependency management Versioning Compile Java code, build jars Execute tests and report results, fail build on failed tests Run quality-check tools (PMD, Findbugs, Checkstyles) File generation (XmlBeans, Xsl, Velocity, AspectJ) Property expansion / token substitution Build vs. deploy vs. release Full control when needed Cross-platform IDE Support Documentation / Support

4 Ant + Ivy Ant is ubiquitous Java-based build tool  Uses XML “script” files Ivy is a dependency manager  Artifact repository  Dependency resolution, including transitive (Project A -> Hibernate -> Commons- Collections)  Sync with external repositories

5 Ant + Ivy Module dependencies are declared in ivy.xml <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

6 Ant + Ivy Add this to your Ant buildfile (build.xml) … retrieve dependencies with ivy"> publish artifacts to local repository">

7 Ant + Ivy Build steps defined and executed with Ant Dependencies managed with Ivy Ant targets to install, retrieve artifacts from Ivy repository

8 Ant + Ivy Image copied from http://ant.apache.org/ivy/history/2.0.0/principle.html

9 Maven Project is defined by POM (Project Object Model)  Projects can contain sub-projects (modules)  Based on recommended project structure (e.g. src/main/java, src/main/resources, src/test/java, …) Artifact-focused (i.e. What files does this build produce?) Heavy emphasis on default configuration

10 Maven Build Lifecycle is defined as Phases, which execute sequentially 1. Validate 2. Compile 3. Test 4. Package 5. Integration-test 6. Verify 7. Install 8. Deploy

11 Maven Each Phase can be made up of zero or more Goals (tasks)  Project-specific configuration involves binding specific goals to specific phases (beyond the default settings) Extensible plugin system (called Mojos)  Java-based or Ant-based  Comprehensive set of third-party plugins available

12 Gradle Built on top of Ant + Ivy Build DSL written in Groovy Uses Groovy AntBuilder  ant.compile, ant.jar Plugins define common tasks to build different types of projects  java, groovy, war, …

13 Gradle Assumes Maven conventions for file locations (drop-in replacement for Maven)  Can be altered with the convention object Can use existing Maven or Ivy repositories

14 Buildr Built on Ruby  Rake is similar to Ant (Ruby Make)  RubyGems is similar to rpm (package manager, handles dependencies)  Build script written in Ruby (internal DSL)

15 Buildr Pre-defined tasks  clean  compile  build  upload  install  javadoc  package  test  uninstall

16 Buildr Assumes Maven conventions for file locations (drop-in replacement for Maven)  Can be altered Can use existing Maven repositories

17 Others Gant Rake EasyAnt Custom ?

18 Results Matrix Desired Feature Ant + IvyMavenGradleBuildr Dependency management Versioningmanually Compile Java code, build jars Execute tests, report results, fail build on failed tests Doesn’t include html reports Run quality check tools (PMD, FindBugs, JavaDoc) 3 rd party task libraries 3 rd party plugins Manually File generation (XmlBeans, XSL, Velocity, AspectJ) 3 rd party task libraries 3 rd party plugins Manually Out of the box Not supported

19 Results Matrix cont’d Desired Feature Ant + IvyMavenGradleBuildr Property expansion / token substitution Build vs. deploy vs. releaseManually defined Full control when neededCustom XML “scripts” Write custom plugin or embedded Ant script Groovy code directly in build file Ruby code directly in build file Cross-platform Runs on JVM Runs on Ruby, may need to compile from source IDE Support Eclipse only Documentation / SupportExcellentGrowing but still inconsistent Decent project documentation, few articles Good project documentation, few articles Out of the box Not supported

20 Subjective Evaluation Ant, Ivy, Maven have been around the longest Restrictive vs. Open philosophy Smart defaults Dependency Management is a Good Thing™ Ant has by far the best documentation and examples available online Gradle is the least mature (but very promising) Buildr is very cool but has potential platform issues (Ruby vs. JRuby, 64-bit)

21 Which Would You Choose?


Download ppt "Java Build Tool Comparison HJUG - April 29th, 2009 John Tyler."

Similar presentations


Ads by Google