SlideShare a Scribd company logo
Practical Maven
       Will Iverson

   cascadetg.com/maven
Agenda
•   Define                  •   Deployment

    •   Why?               •   Tool Commentary

    •   Maven v. Ant       •   Q &A

•   Basics

•   Dependencies                Oh yeah, demos &
                                 examples, too...
•   Repositories
Maven Defined

• Maven is a software project management
  and comprehension tool.

• Based on the concept of a project object
  model (POM), Maven can manage a
  project's build, reporting and documentation
  from a central piece of information.
Why Maven?
     Web Site            Reporting

Documentation            Dependencies

  Tests            JAR         WAR

Continuous Integration      Resources

   Integration Tests     Deployment

          Conditional Builds
Maven “versus” Ant?
        Maven
  Create Artifacts
(e.g. JARs, WARs, EARs, etc...)




                                           Ant
                                  General Purpose Tooling
Maven = Convention
 over Configuration
• Directories
 • Source, Tests, Resources
• Goals
 • Clean, Test, Install, Package, Deploy, Site...
• But... you have to learn the conventions!
 • Maven’s learning curve in a nutshell
Back to Basics

• Let’s create a JAR
• Let’s create a WAR
• Let’s link the two!
Goals and Plugins

   Goal = One Word Target
     e.g. clean, test, compile, deploy


 Plugin = Two Word Action
e.g. compile:compile, jar:test-jar, jetty:run
Ok...

• Built-in super pom.xml (in Maven install)
• Local settings.xml
• Project pom.xml (with packaging)
• Type a goal, and the lifecycle runs the
  bound plugins
Dependencies

• Group
• Artifact
• Version
• Scope
•   Tip: Declare Plugin Dependencies in the Plugin!
Repositories
• Local                           Internet
 • ~/.m2/repository               (ibiblio)

• Remote                        Artifactory
 • Servers that hold released
    binaries                       Local
                                (file system)
 • e.g. Artifactory, Nexus
Reporting
•   Built-In                •   Static Code Analysis
    •  Test Results             •  PMD
•   Plugins                     •  CheckStyle
    •  Test Coverage            •  FindBugs
       (Cobertura)
                            •   //TODO
    •  Javadoc with auto-
       generated UML
    •  Schema
       documentation
       (SchemaSpy)
Deployment
  • Single Command To Deploy
   • Pushes artifact to server
  • (Almost) Single Command To Release
   • Housekeeping + deployment
mvn --batch-mode release:prepare release:perform
Tool Commentary
•   NetBeans 6.7

•   Eclipse (via Plugin)

•   Artifactory, Nexus
                              Defacto Standard?
•   Hudson

•   Repository Format

    •   e.g. SVN HTTP trick
All Star Directories
          Example
•   Most complex project (business-logic)
•   Conditional builds (data-migration, integration tests)
•   ~20 compile, ~15 test dependencies = apx 75 resolved dependencies
•   Automatic releases via Hudson, including JAR, Test JAR, attached sources,
    MD5 hashes
•   Build stamps SVN version # in manifest
•   Database wipe and reset, including DbUnit Fixture generation as part of
    clean - with data extracted from a dependency JAR
•   Site documentation (auto-gen) includes Cobertura code coverage,
    CheckStyle, PMD, FindBugs, full schema info for ~160 tables (including
    diagrams), Javadoc (with autogen UML class diagrams)
•   How many lines of XML?



                         786 lines (including comments)
Q &A

More Related Content

What's hot (18)

PDF
Deploying WO on Windows
WO Community
 
PPTX
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Miguel Zuniga
 
PDF
Testing servers like software
Peter Souter
 
PPTX
Maven
Khan625
 
PPTX
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
ODP
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Axel Faust
 
PPTX
Continuous Delivery and Infrastructure as Code
Sascha Möllering
 
PPTX
Go Faster with Ansible (PHP meetup)
Richard Donkin
 
PPTX
OSDC2014: Testing Server Infrastructure with #serverspec
Andreas Schmidt
 
ZIP
Ruby on the JVM
Kresten Krab Thorup
 
PDF
Apache Whirr
Andrei Savu
 
PDF
Puppet Development Workflow
Jeffery Smith
 
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
PDF
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
ICF CIRCUIT
 
PDF
Steamlining your puppet development workflow
Tomas Doran
 
PPTX
No Docker? No Problem: Automating installation and config with Ansible
Jeff Potts
 
PDF
Provisioning your Environment with Vagrant and Ansible
Richard Gwozdz
 
PPTX
Agile sites @ telmore
Michele Sciabarrà
 
Deploying WO on Windows
WO Community
 
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Miguel Zuniga
 
Testing servers like software
Peter Souter
 
Maven
Khan625
 
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Axel Faust
 
Continuous Delivery and Infrastructure as Code
Sascha Möllering
 
Go Faster with Ansible (PHP meetup)
Richard Donkin
 
OSDC2014: Testing Server Infrastructure with #serverspec
Andreas Schmidt
 
Ruby on the JVM
Kresten Krab Thorup
 
Apache Whirr
Andrei Savu
 
Puppet Development Workflow
Jeffery Smith
 
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
ICF CIRCUIT
 
Steamlining your puppet development workflow
Tomas Doran
 
No Docker? No Problem: Automating installation and config with Ansible
Jeff Potts
 
Provisioning your Environment with Vagrant and Ansible
Richard Gwozdz
 
Agile sites @ telmore
Michele Sciabarrà
 

Viewers also liked (10)

PPTX
Decisions, Decisions: Native to Mobile Web
Will Iverson
 
PDF
Continuous Delivery Overview
Will Iverson
 
PPTX
Greenfield Java 2013
Will Iverson
 
PPTX
QA Lab in the Cloud
Will Iverson
 
PPT
Software Internationalization Crash Course
Will Iverson
 
PPTX
SeaJUG May 2012 mybatis
Will Iverson
 
PPTX
Java CMS 2015
Will Iverson
 
PPTX
Apache-Flink-What-How-Why-Who-Where-by-Slim-Baltagi
Slim Baltagi
 
PPT
Step-by-Step Introduction to Apache Flink
Slim Baltagi
 
PPTX
WTF - Why the Future Is Up to Us - pptx version
Tim O'Reilly
 
Decisions, Decisions: Native to Mobile Web
Will Iverson
 
Continuous Delivery Overview
Will Iverson
 
Greenfield Java 2013
Will Iverson
 
QA Lab in the Cloud
Will Iverson
 
Software Internationalization Crash Course
Will Iverson
 
SeaJUG May 2012 mybatis
Will Iverson
 
Java CMS 2015
Will Iverson
 
Apache-Flink-What-How-Why-Who-Where-by-Slim-Baltagi
Slim Baltagi
 
Step-by-Step Introduction to Apache Flink
Slim Baltagi
 
WTF - Why the Future Is Up to Us - pptx version
Tim O'Reilly
 
Ad

Similar to Practical maven-slides 2 (20)

PDF
Maven 3 Overview
Mike Ensor
 
PPT
Intro to Maven.ppt
MohammadSamiuddin12
 
PPT
Java Build Tools
­Avishek A
 
PPT
Introduction to Maven for projects and carrer ppt
ViratKohli78
 
PDF
Lorraine JUG (1st June, 2010) - Maven
Arnaud Héritier
 
PDF
Apache Maven - eXo TN presentation
Arnaud Héritier
 
PPTX
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 
PPTX
Ci jenkins maven svn
Ankur Goyal
 
KEY
4 maven junit
Honnix Liang
 
PPTX
Java build tools
Sujit Kumar
 
PPTX
Introduction to maven
Manos Georgopoulos
 
PPT
Introduction tomaven
Manav Prasad
 
PPTX
Jenkins advance topic
Gourav Varma
 
PPTX
How maven makes your development group look like a bunch of professionals.
Fazreil Amreen Abdul Jalil
 
PPTX
Jakarta EE Test Strategies (2022)
Ryan Cuprak
 
PDF
Better code, littler classes
drewz lin
 
PPTX
1 java programming- introduction
jyoti_lakhani
 
PPT
Java build tool_comparison
Manav Prasad
 
PDF
Maven Zero to Hero with AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
Ravi Soni
 
PPTX
S/W Design and Modularity using Maven
Scheidt & Bachmann
 
Maven 3 Overview
Mike Ensor
 
Intro to Maven.ppt
MohammadSamiuddin12
 
Java Build Tools
­Avishek A
 
Introduction to Maven for projects and carrer ppt
ViratKohli78
 
Lorraine JUG (1st June, 2010) - Maven
Arnaud Héritier
 
Apache Maven - eXo TN presentation
Arnaud Héritier
 
Java script nirvana in netbeans [con5679]
Ryan Cuprak
 
Ci jenkins maven svn
Ankur Goyal
 
4 maven junit
Honnix Liang
 
Java build tools
Sujit Kumar
 
Introduction to maven
Manos Georgopoulos
 
Introduction tomaven
Manav Prasad
 
Jenkins advance topic
Gourav Varma
 
How maven makes your development group look like a bunch of professionals.
Fazreil Amreen Abdul Jalil
 
Jakarta EE Test Strategies (2022)
Ryan Cuprak
 
Better code, littler classes
drewz lin
 
1 java programming- introduction
jyoti_lakhani
 
Java build tool_comparison
Manav Prasad
 
Maven Zero to Hero with AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
Ravi Soni
 
S/W Design and Modularity using Maven
Scheidt & Bachmann
 
Ad

Recently uploaded (20)

PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Python basic programing language for automation
DanialHabibi2
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 

Practical maven-slides 2

  • 1. Practical Maven Will Iverson cascadetg.com/maven
  • 2. Agenda • Define • Deployment • Why? • Tool Commentary • Maven v. Ant • Q &A • Basics • Dependencies Oh yeah, demos & examples, too... • Repositories
  • 3. Maven Defined • Maven is a software project management and comprehension tool. • Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
  • 4. Why Maven? Web Site Reporting Documentation Dependencies Tests JAR WAR Continuous Integration Resources Integration Tests Deployment Conditional Builds
  • 5. Maven “versus” Ant? Maven Create Artifacts (e.g. JARs, WARs, EARs, etc...) Ant General Purpose Tooling
  • 6. Maven = Convention over Configuration • Directories • Source, Tests, Resources • Goals • Clean, Test, Install, Package, Deploy, Site... • But... you have to learn the conventions! • Maven’s learning curve in a nutshell
  • 7. Back to Basics • Let’s create a JAR • Let’s create a WAR • Let’s link the two!
  • 8. Goals and Plugins Goal = One Word Target e.g. clean, test, compile, deploy Plugin = Two Word Action e.g. compile:compile, jar:test-jar, jetty:run
  • 9. Ok... • Built-in super pom.xml (in Maven install) • Local settings.xml • Project pom.xml (with packaging) • Type a goal, and the lifecycle runs the bound plugins
  • 10. Dependencies • Group • Artifact • Version • Scope • Tip: Declare Plugin Dependencies in the Plugin!
  • 11. Repositories • Local Internet • ~/.m2/repository (ibiblio) • Remote Artifactory • Servers that hold released binaries Local (file system) • e.g. Artifactory, Nexus
  • 12. Reporting • Built-In • Static Code Analysis • Test Results • PMD • Plugins • CheckStyle • Test Coverage • FindBugs (Cobertura) • //TODO • Javadoc with auto- generated UML • Schema documentation (SchemaSpy)
  • 13. Deployment • Single Command To Deploy • Pushes artifact to server • (Almost) Single Command To Release • Housekeeping + deployment mvn --batch-mode release:prepare release:perform
  • 14. Tool Commentary • NetBeans 6.7 • Eclipse (via Plugin) • Artifactory, Nexus Defacto Standard? • Hudson • Repository Format • e.g. SVN HTTP trick
  • 15. All Star Directories Example • Most complex project (business-logic) • Conditional builds (data-migration, integration tests) • ~20 compile, ~15 test dependencies = apx 75 resolved dependencies • Automatic releases via Hudson, including JAR, Test JAR, attached sources, MD5 hashes • Build stamps SVN version # in manifest • Database wipe and reset, including DbUnit Fixture generation as part of clean - with data extracted from a dependency JAR • Site documentation (auto-gen) includes Cobertura code coverage, CheckStyle, PMD, FindBugs, full schema info for ~160 tables (including diagrams), Javadoc (with autogen UML class diagrams) • How many lines of XML? 786 lines (including comments)
  • 16. Q &A