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

PDF
Hacking on WildFly 9
PPTX
Introduction to Ansible - Jan 28 - Austin MeetUp
KEY
Puppet
PPTX
Oak, the architecture of Apache Jackrabbit 3
PDF
Automated Deployment and Configuration Engines. Ansible
PPTX
Apache development with GitHub and Travis CI
PPTX
AVA - a futuristic test runner
PDF
Hosting Ruby Web Apps
Hacking on WildFly 9
Introduction to Ansible - Jan 28 - Austin MeetUp
Puppet
Oak, the architecture of Apache Jackrabbit 3
Automated Deployment and Configuration Engines. Ansible
Apache development with GitHub and Travis CI
AVA - a futuristic test runner
Hosting Ruby Web Apps

What's hot (18)

PDF
Deploying WO on Windows
PPTX
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
PDF
Testing servers like software
PPTX
Maven
PPTX
Ansible: How to Get More Sleep and Require Less Coffee
ODP
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
PPTX
Continuous Delivery and Infrastructure as Code
PPTX
Go Faster with Ansible (PHP meetup)
PPTX
OSDC2014: Testing Server Infrastructure with #serverspec
ZIP
Ruby on the JVM
PDF
Apache Whirr
PDF
Puppet Development Workflow
PDF
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
PDF
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
PDF
Steamlining your puppet development workflow
PPTX
No Docker? No Problem: Automating installation and config with Ansible
PDF
Provisioning your Environment with Vagrant and Ansible
PPTX
Agile sites @ telmore
Deploying WO on Windows
Configuration Management in the Cloud - Cloud Phoenix Meetup Feb 2014
Testing servers like software
Maven
Ansible: How to Get More Sleep and Require Less Coffee
Alfresco Devcon 2019 - Lightning Talk - The Alfresco fat JAR experiment
Continuous Delivery and Infrastructure as Code
Go Faster with Ansible (PHP meetup)
OSDC2014: Testing Server Infrastructure with #serverspec
Ruby on the JVM
Apache Whirr
Puppet Development Workflow
SymfonyCon Madrid 2014 - Rock Solid Deployment of Symfony Apps
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
Steamlining your puppet development workflow
No Docker? No Problem: Automating installation and config with Ansible
Provisioning your Environment with Vagrant and Ansible
Agile sites @ telmore
Ad

Viewers also liked (10)

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

Similar to Practical maven-slides 2 (20)

PDF
Maven 3 Overview
PPT
Intro to Maven.ppt
PPT
Java Build Tools
PPT
Introduction to Maven for projects and carrer ppt
PDF
Lorraine JUG (1st June, 2010) - Maven
PDF
Apache Maven - eXo TN presentation
PPTX
Java script nirvana in netbeans [con5679]
PPTX
Ci jenkins maven svn
KEY
4 maven junit
PPTX
Java build tools
PPTX
Introduction to maven
PPT
Introduction tomaven
PPTX
Jenkins advance topic
PPTX
How maven makes your development group look like a bunch of professionals.
PPTX
Jakarta EE Test Strategies (2022)
PDF
Better code, littler classes
PPTX
1 java programming- introduction
PPT
Java build tool_comparison
PDF
Maven Zero to Hero with AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
PPTX
S/W Design and Modularity using Maven
Maven 3 Overview
Intro to Maven.ppt
Java Build Tools
Introduction to Maven for projects and carrer ppt
Lorraine JUG (1st June, 2010) - Maven
Apache Maven - eXo TN presentation
Java script nirvana in netbeans [con5679]
Ci jenkins maven svn
4 maven junit
Java build tools
Introduction to maven
Introduction tomaven
Jenkins advance topic
How maven makes your development group look like a bunch of professionals.
Jakarta EE Test Strategies (2022)
Better code, littler classes
1 java programming- introduction
Java build tool_comparison
Maven Zero to Hero with AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
S/W Design and Modularity using Maven

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Modernizing your data center with Dell and AMD
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Approach and Philosophy of On baking technology
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
“AI and Expert System Decision Support & Business Intelligence Systems”
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Diabetes mellitus diagnosis method based random forest with bat algorithm
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
Modernizing your data center with Dell and AMD
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
CIFDAQ's Market Insight: SEC Turns Pro Crypto

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