SlideShare une entreprise Scribd logo
1  sur  16
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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

Tendances (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
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Dernier (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

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