SlideShare a Scribd company logo
1 of 3
Maven
Why do we need Maven?
If you are working on Java projects then most of the time you need dependencies.
Dependencies are nothing but libraries or JAR files. You need to download and add
them manually. Also, the task of upgrading the software stack for your project was
done manually before Maven. So there was a need for a better build tool that would
handle such issues.
This where Maven comes into the picture. Maven can solve all your problems related
to dependencies. You just need to specify the dependencies and the software version
that you want in pom.xml file in Maven and Maven will take care of the rest. So now
let us try to understand what exactly Maven is.
What is Maven?
The Maven project is developed by Apache Software Foundation where it was
formerly a part of the Jakarta project. Maven is a powerful build automation tool that
is primarily used for Java-based projects. Maven helps you tackle two critical aspects
of building software -
 It describes how software is built
 It describes the dependencies.
Maven prefers convention over configuration. Maven dynamically downloads Java
libraries and Maven plug-ins from one or more repositories such as the Maven Central
Repository and stores them in a local cache. The artifacts of the local projects can also
be updated with this local cache. Maven can also help you build and manage projects
written in C#, Ruby, Scala, and other languages.
Project Object Model(POM) file is an XML file that contains information related to
the project and configuration information such as dependencies, source directory,
plugin, goals, etc. used by Maven to build the project. When you execute a maven
command you give maven a POM file to execute the commands. Maven reads the
pom.xml file to accomplish its configuration and operations.
When should someone use Maven?
1. If there are too many dependencies for the project.
2. When the dependency version update frequently.
3. Continuous builds,integration,and testing can be easily handled by usingmaven.
4. When one needs an easy way to generate documentation from the sourcecode, compiling
the sourcecode, packagingcompiled code into JAR files or ZIP files.
The POM
The pom.xml file is the core of a project's configuration in Maven. It is a single
configuration file that contains the majority of information required to build a project
in just the way you want. The POM is huge and can be daunting in its complexity, but
it is not necessary to understand all of the intricacies just yet to use it effectively.
 Once you create the projectthen you will seethe project structureof your Maven project.
Here you can see the followingthings –
1. pom.xml
2. src and target
3. src/main/java
4. src/test/java
5. Maven dependencies
1. <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
3. <modelVersion>4.0.0</modelVersion>
4.
5. <groupId>com.mycompany.app</groupId>
6. <artifactId>my-app</artifactId>
7. <version>1.0-SNAPSHOT</version>
8.
9. <properties>
10. <maven.compiler.source>1.7</maven.compiler.source>
11. <maven.compiler.target>1.7</maven.compiler.target>
12. </properties>
13.
14. <dependencies>
15. <dependency>
16. <groupId>junit</groupId>
17. <artifactId>junit</artifactId>
18. <version>4.12</version>
19. <scope>test</scope>
20. </dependency>
21. </dependencies>
22. </project>

More Related Content

What's hot

Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeHolasz Kati
 
Getting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseGetting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseVMware Tanzu
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 featuresAngel Ruiz
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2andyhot
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevWerner Keil
 
CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesJesse Gallagher
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The BasicsPhilip Langer
 
Selenium Java for Beginners by Sujit Pathak
Selenium Java for Beginners by Sujit PathakSelenium Java for Beginners by Sujit Pathak
Selenium Java for Beginners by Sujit PathakSoftware Testing Board
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache MavenMudit Gupta
 

What's hot (20)

Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 
Maven tutorial for beginners
Maven tutorial for beginnersMaven tutorial for beginners
Maven tutorial for beginners
 
Getting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA releaseGetting Reactive with Spring Framework 5.0’s GA release
Getting Reactive with Spring Framework 5.0’s GA release
 
Selenium
SeleniumSelenium
Selenium
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Maven 2 Introduction
Maven 2 IntroductionMaven 2 Introduction
Maven 2 Introduction
 
Using Maven 2
Using Maven 2Using Maven 2
Using Maven 2
 
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDevTriple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
Triple E class DevOps with Hudson, Maven, Kokki/Multiconf and PyDev
 
Maven
MavenMaven
Maven
 
CollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPagesCollabSphere 2018 - Java in Domino After XPages
CollabSphere 2018 - Java in Domino After XPages
 
Maven
MavenMaven
Maven
 
Play Framework: The Basics
Play Framework: The BasicsPlay Framework: The Basics
Play Framework: The Basics
 
Selenium Java for Beginners by Sujit Pathak
Selenium Java for Beginners by Sujit PathakSelenium Java for Beginners by Sujit Pathak
Selenium Java for Beginners by Sujit Pathak
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
 
Selenium using C# by Yogesh Kumar
Selenium using C# by  Yogesh KumarSelenium using C# by  Yogesh Kumar
Selenium using C# by Yogesh Kumar
 
SpringBoot
SpringBootSpringBoot
SpringBoot
 
Java spring ppt
Java spring pptJava spring ppt
Java spring ppt
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
 

Similar to Maven (20)

Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
 
Maven
MavenMaven
Maven
 
What is maven
What is mavenWhat is maven
What is maven
 
Maven Nexus
Maven NexusMaven Nexus
Maven Nexus
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
Maven
MavenMaven
Maven
 
A-Z_Maven.pdf
A-Z_Maven.pdfA-Z_Maven.pdf
A-Z_Maven.pdf
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
 
Maven basics
Maven basicsMaven basics
Maven basics
 
Introduction to maven
Introduction to mavenIntroduction to maven
Introduction to maven
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
 
Maven
MavenMaven
Maven
 
An Introduction to Maven
An Introduction to MavenAn Introduction to Maven
An Introduction to Maven
 
SE2018_Lec-22_-Continuous-Integration-Tools
SE2018_Lec-22_-Continuous-Integration-ToolsSE2018_Lec-22_-Continuous-Integration-Tools
SE2018_Lec-22_-Continuous-Integration-Tools
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
 
Maven overview
Maven overviewMaven overview
Maven overview
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 

More from penetration Tester (20)

Jenkins
JenkinsJenkins
Jenkins
 
Sonar qube
Sonar qubeSonar qube
Sonar qube
 
Owasp zap
Owasp zapOwasp zap
Owasp zap
 
Sonarlint
SonarlintSonarlint
Sonarlint
 
Shift left
Shift leftShift left
Shift left
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment Strategies
 
DSOMM
DSOMMDSOMM
DSOMM
 
Devops
DevopsDevops
Devops
 
Shift left
Shift leftShift left
Shift left
 
Lfi
LfiLfi
Lfi
 
Directory traversal
Directory traversalDirectory traversal
Directory traversal
 
Burp documentation
Burp documentationBurp documentation
Burp documentation
 
7 layer OSI model
7 layer OSI model7 layer OSI model
7 layer OSI model
 
Virtual box
Virtual boxVirtual box
Virtual box
 
Tcp IP OSI
Tcp IP OSITcp IP OSI
Tcp IP OSI
 
Burp repeater
Burp repeaterBurp repeater
Burp repeater
 
Burp intruder
Burp intruderBurp intruder
Burp intruder
 
Hippa
Hippa Hippa
Hippa
 
Nist
NistNist
Nist
 
Isms
IsmsIsms
Isms
 

Recently uploaded

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

Maven

  • 1. Maven Why do we need Maven? If you are working on Java projects then most of the time you need dependencies. Dependencies are nothing but libraries or JAR files. You need to download and add them manually. Also, the task of upgrading the software stack for your project was done manually before Maven. So there was a need for a better build tool that would handle such issues. This where Maven comes into the picture. Maven can solve all your problems related to dependencies. You just need to specify the dependencies and the software version that you want in pom.xml file in Maven and Maven will take care of the rest. So now let us try to understand what exactly Maven is. What is Maven? The Maven project is developed by Apache Software Foundation where it was formerly a part of the Jakarta project. Maven is a powerful build automation tool that is primarily used for Java-based projects. Maven helps you tackle two critical aspects of building software -  It describes how software is built  It describes the dependencies. Maven prefers convention over configuration. Maven dynamically downloads Java libraries and Maven plug-ins from one or more repositories such as the Maven Central Repository and stores them in a local cache. The artifacts of the local projects can also be updated with this local cache. Maven can also help you build and manage projects written in C#, Ruby, Scala, and other languages. Project Object Model(POM) file is an XML file that contains information related to the project and configuration information such as dependencies, source directory, plugin, goals, etc. used by Maven to build the project. When you execute a maven command you give maven a POM file to execute the commands. Maven reads the pom.xml file to accomplish its configuration and operations.
  • 2. When should someone use Maven? 1. If there are too many dependencies for the project. 2. When the dependency version update frequently. 3. Continuous builds,integration,and testing can be easily handled by usingmaven. 4. When one needs an easy way to generate documentation from the sourcecode, compiling the sourcecode, packagingcompiled code into JAR files or ZIP files. The POM The pom.xml file is the core of a project's configuration in Maven. It is a single configuration file that contains the majority of information required to build a project in just the way you want. The POM is huge and can be daunting in its complexity, but it is not necessary to understand all of the intricacies just yet to use it effectively.  Once you create the projectthen you will seethe project structureof your Maven project. Here you can see the followingthings – 1. pom.xml 2. src and target 3. src/main/java 4. src/test/java 5. Maven dependencies 1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 3. <modelVersion>4.0.0</modelVersion> 4. 5. <groupId>com.mycompany.app</groupId> 6. <artifactId>my-app</artifactId> 7. <version>1.0-SNAPSHOT</version> 8. 9. <properties> 10. <maven.compiler.source>1.7</maven.compiler.source>
  • 3. 11. <maven.compiler.target>1.7</maven.compiler.target> 12. </properties> 13. 14. <dependencies> 15. <dependency> 16. <groupId>junit</groupId> 17. <artifactId>junit</artifactId> 18. <version>4.12</version> 19. <scope>test</scope> 20. </dependency> 21. </dependencies> 22. </project>