SlideShare a Scribd company logo
1 of 10
Download to read offline
Intro to Maven
Maven as a Convention
Maven Build Life Cycle
https://medium.com/@yetanothersoftwareengineer/maven-lifecycle-phases-plugins-and-goals-25d8e33fa22
Phase
Life Cycle
Some Plugin
Plugins
sayhi
deploy
install
verify
Goal
Dependencies
● Compile
● Provided
● Runtime
● Test
● System
● Import
Dependency Management
Local
Repository
Dependency
Cache
Dependency
Manager
Dependency
Configuration
Network
Maven Central
...
...
Maven Repository Structure
● repo1.maven.org/maven
○ org
■ apache
● commons
○ commons-lang3
■ 3.12.0
● ...pom
● ...jar
● ...sha1
group
artifact
version
Dependency Hierarchy
A
1.0.1
B
2.3
C
4.5
Ant vs Maven vs Gradle
● Ant
● Maven
● Gradle
Ant vs Maven vs Gradle
● General
● Dependency Management
● Build Life Cycle
● Dealing with Non-Java

More Related Content

More from John Valentino

Benefits in Software Development
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software DevelopmentJohn Valentino
 
Talking Money in Software Development
Talking Money in Software DevelopmentTalking Money in Software Development
Talking Money in Software DevelopmentJohn Valentino
 
Getting Software Dev Experience
Getting  Software Dev ExperienceGetting  Software Dev Experience
Getting Software Dev ExperienceJohn Valentino
 
Software Developer Resumes
Software Developer ResumesSoftware Developer Resumes
Software Developer ResumesJohn Valentino
 
Searching for a Software Job
Searching for a Software JobSearching for a Software Job
Searching for a Software JobJohn Valentino
 
Researching a Software Job
Researching a Software JobResearching a Software Job
Researching a Software JobJohn Valentino
 
Interviewing as a Developer
Interviewing as a DeveloperInterviewing as a Developer
Interviewing as a DeveloperJohn Valentino
 
Developer: A Day in the Life
Developer: A Day in the LifeDeveloper: A Day in the Life
Developer: A Day in the LifeJohn Valentino
 
Quality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeJohn Valentino
 
Lead Developer: A Day in the Life
Lead Developer: A Day in the LifeLead Developer: A Day in the Life
Lead Developer: A Day in the LifeJohn Valentino
 

More from John Valentino (13)

Startups 101
Startups 101Startups 101
Startups 101
 
Benefits in Software Development
Benefits in Software DevelopmentBenefits in Software Development
Benefits in Software Development
 
Talking Money in Software Development
Talking Money in Software DevelopmentTalking Money in Software Development
Talking Money in Software Development
 
Getting Software Dev Experience
Getting  Software Dev ExperienceGetting  Software Dev Experience
Getting Software Dev Experience
 
Software Developer Resumes
Software Developer ResumesSoftware Developer Resumes
Software Developer Resumes
 
Software Recruiters
Software RecruitersSoftware Recruiters
Software Recruiters
 
Searching for a Software Job
Searching for a Software JobSearching for a Software Job
Searching for a Software Job
 
Researching a Software Job
Researching a Software JobResearching a Software Job
Researching a Software Job
 
Interviewing as a Developer
Interviewing as a DeveloperInterviewing as a Developer
Interviewing as a Developer
 
Developer: A Day in the Life
Developer: A Day in the LifeDeveloper: A Day in the Life
Developer: A Day in the Life
 
Agile 101
Agile 101Agile 101
Agile 101
 
Quality Engineer: A Day in the Life
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
 
Lead Developer: A Day in the Life
Lead Developer: A Day in the LifeLead Developer: A Day in the Life
Lead Developer: A Day in the Life
 

Recently uploaded

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 

Recently uploaded (20)

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

Introduction to Maven

Editor's Notes

  1. Project Object Model (POM)
  2. The goal you indicate in the command line is linked to the lifecycle of Maven. For example, the build lifecycle (you also have the clean and site lifecycles which are different) is composed of the following phases: validate: validate the project is correct and all necessary information is available. compile: compile the source code of the project. test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed. package: take the compiled code and package it in its distributable format, such as a JAR. integration-test: process and deploy the package if necessary into an environment where integration tests can be run. verify: run any checks to verify the package is valid and meets quality criteria install: install the package into the local repository, for use as a dependency in other projects locally. deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
  3. Compile - This is the default scope when no other scope is provided. Dependencies with this scope are available on the classpath of the project in all build tasks. They are also propagated to the dependent projects. They are also transitive Provided - We use this scope to mark dependencies that should be provided at runtime by JDK or a container. A good use case for this scope would be a web application deployed in some container, where the container already provides some libraries itself. For example, this could be a web server that already provides the Servlet API at runtime. The provided dependencies are available only at compile time and in the test classpath of the project. These dependencies are also not transitive. Runtime - The dependencies with this scope are required at runtime. But we don't need them for the compilation of the project code. Because of that, dependencies marked with the runtime scope will be present in the runtime and test classpath, but they will be missing from the compile classpath. A JDBC driver is a good example of dependencies that should use the runtime scope: Test - We use this scope to indicate that dependency isn't required at standard runtime of the application but is used only for test purposes.Test dependencies aren't transitive and are only present for test and execution classpaths. The standard use case for this scope is adding a test library such as JUnit to our application: System - System scope is very similar to the provided scope. The main difference is that system requires us to directly point to a specific jar on the system.It's worthwhile to mention that system scope is deprecated. Import - It's only available for the dependency type pom. import indicates that this dependency should be replaced with all effective dependencies declared in its POM.
  4. Ant: Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extensions points dependent upon each other (http://ant.apache.org/manual). Maven: Apache 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 (https://maven.apache.org/). Gradle: Gradle is an open-source build automation tool focused on flexibility and performance. Gradle build scripts are written using a Groovy or Kotlin DSL (https://docs.gradle.org/current/userguide/userguide.html).
  5. 2.1 General · Ant - No conventions and everything is procedural, at least when you declare it that way. You can do whatever you want and, in any order, because Ant is a toolbox. · Maven - Conventions that you are stuck to because Maven is a framework. Syntax is also limited to declarative. · Gradle - Conventions from which you can easily deviate, and also the ability to be both procedural and declarative. 2.2 Dependency Management · Ant - None built in, and requires you to use Ivy (http://ant.apache.org/ivy/). Downloading dependencies to use as part of your Ant build also requires some strange looking boilerplate code, so that you define Ant task definitions after having the jar files available. · Maven - Built in but difficult to customize (http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html) · Gradle - Built in and easy to customize (http://www.gradle.org/docs/current/userguide/dependency_management.html) 2.3 Build Life Cycle · Ant - Made up of targets, which can depend on or call other targets. There is no enforced life cycle, which can lead to chaotic builds. · Maven - Made up of 3 life cycles, which are made of phases, which are made up of goals. There are 30 phases used to cover the clean, default, and site life cycles. (http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html) · Gadle - Made up of three distinct phases: Initialization, Configuration, and Execution. This is significantly simpler than the 30 phases of maven. (http://www.gradle.org/docs/current/userguide/build_lifecycle.html) 2.4 Dealing with non-Java Ant - With easy access to the command-line and the ability to do whatever you want, non-Java support is only limited by your imagination. Dealing with programmatic problems in a declarative language leads to complexity, for example when doing modular Flex, a mostly dead language (https://stackoverflow.blog/2017/08/01/flash-dead-technologies-might-next/), builds (http://jvalentino.blogspot.com/2010/03/flex-ant-build-optimized-modules_24.html) · Maven - If you want to deal with non-Java you are going to need to write a custom plugin. When I used to work with Flex it was much easier to build an Ant macro and put it in a jar versus building a Maven plugin. · Gradle - It is possible to do the same things you did with Ant, or deal with and possibly write your own Gradle plugin.