SlideShare a Scribd company logo
Java Build Tools
 Desired Features
            Ant
            Maven
            Ant vs Maven
CONTENTS
Whats expected of build

                          •   Versioning
                          •   Compile Java code, build jars
                          •   Execute tests and report results
                          •   Run quality-check tools (PMD, Findbugs..)
                          •   Build vs. deploy vs. release
                          •   Cross-platform
                          •   IDE Support
                          •   Documentation / Support
tools
 Java-based build tool
            Mature
            Stable
            Rich library of tasks
WHY ANT!
   Ant With Convention Over Configuration
                Dependency Management
                Uniform Build System.
                Project Structure.
                Coherent site of project information along-with
                 Internationalization.
                Release management and distribution publication.
WHY MAVEN!
Concerns to build a project


                               Project directory structure
                               Directory naming conventions
                               The build output
   Contains project information and configuration details used to
                           build the project
                           ◦   – Project dependencies
                           ◦   – Commands (goals) that can be executed
Project Object Model
                           ◦   – Plugins
                           ◦   – Metadata
                          The minimum requirement for a POM are the following:
                           ◦   project root
                           ◦   modelVersion - should be set to 4.0.0
                           ◦   groupId - the id of the project's group.
                           ◦   artifactId - the id of the artifact (project)
                           ◦   version - the version of the artifact under the specified group
                           e.g.:
                           ◦   <modelVersion>4.0.0</modelVersion>
                           ◦   <groupId>com.cisco.ccw.config</groupId>
                           ◦   <artifactId>ConfigService</artifactId>
                           ◦   <packaging>jar</packaging>
                           ◦   <version>7.0</version>
                           ◦   <name>CCW Config Services</name>
                           ◦   <url>http://www.cisco.com</url>
Java Build Tools
Project inheritance
Project aggregation
Build Lifecycle and Phases
   Most important default phases:
    ◦ Validate
    ◦ Compile
    ◦ Test
    ◦ Package
    ◦ Install
    ◦ Deploy

   Some common phases not default:
    ◦ Clean
    ◦ Site
Dependency scope
   Compile: Available in all classpaths (default)
   Provided: The JDK or the container provides it
   Runtime: Only required for execution, not for
    compilation
   Test: Only required for testing, not for normal use (not
    deployed)
   System: You provide it locally, not looked up in a repo
         <dependency>
         <groupId>commons-logging</groupId>
         <artifactId>commons-logging</artifactId>
         <version>1.4</version>
         <scope>compile</scope>
         </dependency>
FEATURES                                                    ANT                MAVEN
               Dependency Management

               Versioning                                                  Manually defined

               Compile Java code, build jars

               Execute tests, report results, fail build on failed tests

               Build vs. deploy vs. release                                Manually defined

               Full control when needed                                    Custom XML         Write custom
                                                                           “scripts”          plugin or
                                                                                              embedded Ant
                                                                                              script
               Documentation / Support                                     Excellent          Growing but still
Ant vs Maven




                                                                                              inconsistent
               Run quality check tools (PMD, FindBugs, JavaDoc)            3rd party task     3rd party plugins
                                                                           libraries
               File generation (XmlBeans, XSL, Velocity, AspectJ)          3rd party task     3rd party plugins
                                                                           libraries
               Generating the Site
Reference
   http://en.wikipedia.org/wiki/List_of_build_automation_softwar
    e
   http://maven.apache.org/maven-features.html

More Related Content

PDF
PHP Con09: SVN Advanced
PDF
Intelligent Projects with Maven - DevFest Istanbul
PDF
Introduction to YouDebug - Scriptable Java Debugger
PDF
Jdc 2010 - Maven, Intelligent Projects
PDF
Alpes Jug (29th March, 2010) - Apache Maven
PDF
Geneva Jug (30th March, 2010) - Maven
PPT
Automating Drupal Deployment
PDF
미들웨어 엔지니어의 클라우드 탐방기
PHP Con09: SVN Advanced
Intelligent Projects with Maven - DevFest Istanbul
Introduction to YouDebug - Scriptable Java Debugger
Jdc 2010 - Maven, Intelligent Projects
Alpes Jug (29th March, 2010) - Apache Maven
Geneva Jug (30th March, 2010) - Maven
Automating Drupal Deployment
미들웨어 엔지니어의 클라우드 탐방기

What's hot (20)

PPTX
Apache Maven
PDF
Java is evolving rapidly: Maven helps you staying on track
PDF
BMO - Intelligent Projects with Maven
PPSX
RequireJS
PDF
Maven tutorial
PDF
maven build certificaton
PPTX
Netbeans
PDF
Software Testen mit Visual Studio Lab Management
PDF
As7 web services - JUG Milan April 2012
PPTX
PDF
Busy developer-html5-javaee7
PDF
Running Spring Boot Applications as GraalVM Native Images
PDF
Webdriver.io
PPTX
Intro to Angular.js & Zend2 for Front-End Web Applications
PPTX
Gradle,the new build system for android
PPTX
Development of automated tests for ext js based web sites
PDF
One step in the future: CSS variables
DOC
Project bcool standards document
PPTX
Micronaut: A new way to build microservices
PDF
Java server face tutorial
Apache Maven
Java is evolving rapidly: Maven helps you staying on track
BMO - Intelligent Projects with Maven
RequireJS
Maven tutorial
maven build certificaton
Netbeans
Software Testen mit Visual Studio Lab Management
As7 web services - JUG Milan April 2012
Busy developer-html5-javaee7
Running Spring Boot Applications as GraalVM Native Images
Webdriver.io
Intro to Angular.js & Zend2 for Front-End Web Applications
Gradle,the new build system for android
Development of automated tests for ext js based web sites
One step in the future: CSS variables
Project bcool standards document
Micronaut: A new way to build microservices
Java server face tutorial
Ad

Viewers also liked (20)

PDF
Ant_quick_guide
PDF
Zen and-the-art-of-build-script-maintenance-skillsmatter
PPTX
Jvm a brief introduction
PDF
Architecting your Frontend
PDF
Angular.js
PPTX
Gradle 2.Write once, builde everywhere
PDF
Make Your Builds More Groovy
PPTX
Apache maven 2 overview
KEY
4장. Class Loader
PPTX
Tutorial to develop build files using ANT
PPTX
Apache maven 2 overview
PPTX
Apache ant
PDF
Java Classloaders
PDF
Java Build Tool course in 2011
ZIP
Automated Frontend Testing
PPT
Apache Ant
PDF
Front-End Testing: Demystified
PPT
Apache Ant
KEY
Erlang vs. Java
PDF
Ant_quick_guide
Zen and-the-art-of-build-script-maintenance-skillsmatter
Jvm a brief introduction
Architecting your Frontend
Angular.js
Gradle 2.Write once, builde everywhere
Make Your Builds More Groovy
Apache maven 2 overview
4장. Class Loader
Tutorial to develop build files using ANT
Apache maven 2 overview
Apache ant
Java Classloaders
Java Build Tool course in 2011
Automated Frontend Testing
Apache Ant
Front-End Testing: Demystified
Apache Ant
Erlang vs. Java
Ad

Similar to Java Build Tools (20)

PDF
Maven 3 Overview
PDF
Practical maven-slides 2
PDF
Hands On with Maven
PDF
Maven: from Scratch to Production (.pdf)
PPTX
Ci jenkins maven svn
PDF
Java Builds with Maven and Ant
PDF
Apache Maven - eXo TN presentation
PPTX
An Introduction to Maven
ODP
An Introduction to Maven Part 1
PDF
Apache Continuum Build, Test, and Release
PDF
Lorraine JUG (1st June, 2010) - Maven
PPT
Presentation 1 open source tools in continuous integration environment v1.0
PDF
Riviera JUG (20th April, 2010) - Maven
PDF
Lausanne Jug (08th April, 2010) - Maven
PDF
Maven2交流
PPTX
How maven makes your development group look like a bunch of professionals.
PPTX
Apache Maven
PDF
Apache Maven at GenevaJUG by Arnaud Héritier
PDF
Introduction in Apache Maven2
PPTX
Continuous Deployment Pipeline with maven
Maven 3 Overview
Practical maven-slides 2
Hands On with Maven
Maven: from Scratch to Production (.pdf)
Ci jenkins maven svn
Java Builds with Maven and Ant
Apache Maven - eXo TN presentation
An Introduction to Maven
An Introduction to Maven Part 1
Apache Continuum Build, Test, and Release
Lorraine JUG (1st June, 2010) - Maven
Presentation 1 open source tools in continuous integration environment v1.0
Riviera JUG (20th April, 2010) - Maven
Lausanne Jug (08th April, 2010) - Maven
Maven2交流
How maven makes your development group look like a bunch of professionals.
Apache Maven
Apache Maven at GenevaJUG by Arnaud Héritier
Introduction in Apache Maven2
Continuous Deployment Pipeline with maven

Java Build Tools

  • 2.  Desired Features  Ant  Maven  Ant vs Maven CONTENTS
  • 3. Whats expected of build • Versioning • Compile Java code, build jars • Execute tests and report results • Run quality-check tools (PMD, Findbugs..) • Build vs. deploy vs. release • Cross-platform • IDE Support • Documentation / Support tools
  • 4.  Java-based build tool  Mature  Stable  Rich library of tasks WHY ANT!
  • 5. Ant With Convention Over Configuration  Dependency Management  Uniform Build System.  Project Structure.  Coherent site of project information along-with Internationalization.  Release management and distribution publication. WHY MAVEN!
  • 6. Concerns to build a project  Project directory structure  Directory naming conventions  The build output
  • 7. Contains project information and configuration details used to build the project ◦ – Project dependencies ◦ – Commands (goals) that can be executed Project Object Model ◦ – Plugins ◦ – Metadata  The minimum requirement for a POM are the following: ◦ project root ◦ modelVersion - should be set to 4.0.0 ◦ groupId - the id of the project's group. ◦ artifactId - the id of the artifact (project) ◦ version - the version of the artifact under the specified group e.g.: ◦ <modelVersion>4.0.0</modelVersion> ◦ <groupId>com.cisco.ccw.config</groupId> ◦ <artifactId>ConfigService</artifactId> ◦ <packaging>jar</packaging> ◦ <version>7.0</version> ◦ <name>CCW Config Services</name> ◦ <url>http://www.cisco.com</url>
  • 11. Build Lifecycle and Phases  Most important default phases: ◦ Validate ◦ Compile ◦ Test ◦ Package ◦ Install ◦ Deploy  Some common phases not default: ◦ Clean ◦ Site
  • 12. Dependency scope  Compile: Available in all classpaths (default)  Provided: The JDK or the container provides it  Runtime: Only required for execution, not for compilation  Test: Only required for testing, not for normal use (not deployed)  System: You provide it locally, not looked up in a repo  <dependency>  <groupId>commons-logging</groupId>  <artifactId>commons-logging</artifactId>  <version>1.4</version>  <scope>compile</scope>  </dependency>
  • 13. FEATURES ANT MAVEN Dependency Management Versioning Manually defined Compile Java code, build jars Execute tests, report results, fail build on failed tests Build vs. deploy vs. release Manually defined Full control when needed Custom XML Write custom “scripts” plugin or embedded Ant script Documentation / Support Excellent Growing but still Ant vs Maven inconsistent Run quality check tools (PMD, FindBugs, JavaDoc) 3rd party task 3rd party plugins libraries File generation (XmlBeans, XSL, Velocity, AspectJ) 3rd party task 3rd party plugins libraries Generating the Site
  • 14. Reference  http://en.wikipedia.org/wiki/List_of_build_automation_softwar e  http://maven.apache.org/maven-features.html