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

Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
WO Community
 

What's hot (18)

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

Viewers also liked

Decisions, Decisions: Native to Mobile Web
Decisions, Decisions: Native to Mobile WebDecisions, Decisions: Native to Mobile Web
Decisions, Decisions: Native to Mobile Web
Will Iverson
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatis
Will Iverson
 

Viewers also liked (10)

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

Similar to Practical maven-slides 2

Java build tools
Java build toolsJava build tools
Java build tools
Sujit Kumar
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.
Fazreil Amreen Abdul Jalil
 
Better code, littler classes
Better code, littler classesBetter code, littler classes
Better code, littler classes
drewz lin
 

Similar to Practical maven-slides 2 (20)

Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
 
Intro to Maven.ppt
Intro to Maven.pptIntro to Maven.ppt
Intro to Maven.ppt
 
Java Build Tools
Java Build ToolsJava Build Tools
Java Build Tools
 
Lorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - MavenLorraine JUG (1st June, 2010) - Maven
Lorraine JUG (1st June, 2010) - Maven
 
Apache Maven - eXo TN presentation
Apache Maven - eXo TN presentationApache Maven - eXo TN presentation
Apache Maven - eXo TN presentation
 
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
 
4 maven junit
4 maven junit4 maven junit
4 maven junit
 
Java build tools
Java build toolsJava build tools
Java build tools
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomaven
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 
How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.How maven makes your development group look like a bunch of professionals.
How maven makes your development group look like a bunch of professionals.
 
Jakarta EE Test Strategies (2022)
Jakarta EE Test Strategies (2022)Jakarta EE Test Strategies (2022)
Jakarta EE Test Strategies (2022)
 
Better code, littler classes
Better code, littler classesBetter code, littler classes
Better code, littler classes
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
Java build tool_comparison
Java build tool_comparisonJava build tool_comparison
Java build tool_comparison
 
Maven Zero to Hero with AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
Maven Zero to Hero with  AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...Maven Zero to Hero with  AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
Maven Zero to Hero with AWS CodeCommit, CodeArtifact, ECR, OWASP Dependency ...
 
S/W Design and Modularity using Maven
S/W Design and Modularity using MavenS/W Design and Modularity using Maven
S/W Design and Modularity using Maven
 
Maven
MavenMaven
Maven
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»НАДІЯ ФЕДЮШКО БАЦ  «Професійне зростання QA спеціаліста»
НАДІЯ ФЕДЮШКО БАЦ «Професійне зростання QA спеціаліста»
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 

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