SlideShare a Scribd company logo
Build Automation With maven
(By Ankit Gubrani)
Agenda
q What is maven?
q Why maven?
q Maven Installation.
q How maven works.
q The build Lifecycle.
q Basics of POM, Profiles, Repositories.
q Maven Plugins.
q Maven Dependency.
q Creating custom maven Plugin.
What is maven ?
Any Idea?
Ok but before that !
What is a build tool?
Build Tool
q A build tool is a programming utility that is used when
building a new version of a program.
q Build tools are tools to manage and organise your
builds.
Build Automation using Maven
Now that you know What Build Tool is.
Here is Maven -
Maven
q Maven is a popular open source build tool used primarily
for Java projects. It was designed to make build
process easier task.
q Apart from being a build tool Maven can also manage
reporting and documentation from a central piece of
information.
q It is based on the concept of a project object model
(POM).
q Maven is more than just a "build tool" rather is a
project management tool.
Maven provides developers ways to manage following:
q Builds
q Documentation
q Reporting
q Dependencies
q SCMs
q Releases
q Distribution
q Mailing list
Why Maven if we have other Build tools
available ???
Comparison
Here are some of the benefits of using Maven over any
other build (Ant, make etc) :
q Standardized project layout. (Convention over
configuration unlike ANT)
q Automatic dependency handling.(Ant can't do this
unassisted)
q Large Existing repository.
q Reusability ( through Maven Plugins).
Maven Installation
Installation
q Maven is a Java tool, so you must have Java installed in
order to proceed.
q Follow the instructions on the link for intallation :
http://maven.apache.org/download.cgi#Installatio
n
q Once installation is done type the following command in
a terminal or in a command prompt:
mvn –version
It should print out your installed version of Maven
Build Automation using Maven
Maven Build Lifecycle
Lifecycle
q Build Lifecycle is a well defined sequence of phases
which define the order in which the goals are to be
executed. Here phase represents a stage in life cycle.
q When Maven starts building a project, it steps through
a defined sequence of phases and executes goals which
are registered with each phase. Maven has following
three standard lifecycles:
q Clean
q default(or build)
q Site
q A Build Lifecycle is Made Up of Phases.
q A Build Phase is Made Up of Plugin Goals.
q A Plugin Goal represents a specific task (finer than a
build phase) which contributes to the building and
managing of a project.
lPhase-Goal Binding
lLifecycle-Phase Binding
POM
lProject Object Model
q POM stands for Project Object Model. It is
fundamental Unit of work in Maven.
q It is an XML file. It always resides in the base
directory of the project as pom.xml.
q The POM contains information about the project and
various configuration detail used by Maven to build the
project.
lSome of the configuration that can be specified in the
POM are following:
q project dependencies
q plugins
q goals
q build profiles
q project version
q developers
q mailing list
Maven Repository
q A maven repository is a directory of packaged JAR file with
pom.xml file. Maven searches for dependencies in the
repositories. There are 3 types of maven repostory :
§ Local Repository
§ Central Repository
§ Remote Repository
q Maven searches for the dependencies in the following order:
q Local repository then Central repository then Remote
repository.
q Local Repository :-
§ Maven local repository is located in your local
system. It is created by the maven when you run
any maven command.
§ By default, maven local repository is
%USER_HOME%/.m2 directory. For example:
C:UsersSSS IT.m2.
q Central Repository :-
§ Maven central repository is located on the web. It
has been created by the apache maven community
itself.
§ The path of central repository is:
http://repo1.maven.org/maven2 .
q Remote Repository :-
§ Maven remote repository is located on the web.
Most of libraries can be missing from the central
repository such as JBoss library etc, so we need to
define remote repository in pom.xml file.
Build Profile
q A Build profile is a set of configuration values which can be
used to set or override default values of Maven build. Using
a build profile, you can customize build for different
environments such as Production v/s Development
environments.
q Build profiles are majorly of three types :
§ Per Project :- Defined in the project POM file, pom.xml
§ Per User :- Defined in Maven settings xml file
(%USER_HOME%/.m2/settings.xml)
§ Global :- Defined in Maven global settings xml file
(%M2_HOME%/conf/settings.xml)
Maven Plugins
q Plugins are the central feature of Maven that allow for the
reuse of common build logic across multiple projects.
q Maven is actually a plugin execution framework where every
task is actually done by plugins.
q A plugin generally provides a set of goals and which can be
executed using following syntax:
ü mvn [plugin-name]:[goal-name]
q There are plugins for almost every task in maven like plugins
are used to: create jar files, create war files, compile code,
unit test code, create project documentation, and on and on.
q Maven provides following two types of Plugins:
1)Build plugins:- They execute during the build and should be
configured in the <build/> element of pom.xml .
2)Reporting plugins:-They execute during the site
generation and they should be configured in the
<reporting/> element of the pom.xml .
Archetype
lAn archetype is defined as an original pattern or model from
which all other things of the same kind are made.
lMaven provides users,a very large list of different types of
project templates using concept of Archetype. Maven helps
users to quickly start a new java project using following
command :
mvn archetype:generate
lArchetype is a Maven plugin whose task is to create a project
structure as per its template. Archetype Plugin allows the user
to create a Maven project from an existing template called an
archetype.
Archetype
Now that you know basics of maven,
Let's create a maven project
q For creating any project maven provides templates(Archetype),
using which one can create by selecting any one archetype from
available archetypes.
q To start a new Maven project, use the Maven Archetype plugin from
the command line. Run the following command :-
§ mvn archetype:generate -DarchetypeGroupId=[Group Id] -
DarchetypeArtifactId= [Artifact ID]
q You can search for all archetypes provided by maven at there
central repository (http://search.maven.org/) and all other 3rd
party archetypes at any remote repository like -
http://mvnrepository.com
Demo
Maven Snapshots
q SNAPSHOT is a special version that indicates a current
development copy.
q Unlike regular versions, Maven checks for a new
SNAPSHOT version in a remote repository for every build.
q Snapshot vs Version :-
q In case of Version, if Maven once downloaded the mentioned
version say data-service:1.0, it will never try to download a
newer 1.0 available in repository. To download the updated
code, artifact version is be upgraded to 1.1.
q In case of SNAPSHOT, Maven will automatically fetch the
latest SNAPSHOT (data-service:1.0-SNAPSHOT)
everytime app-ui team build their project.
Hey did you notice ???
What we did till now automated the build
process. And this is called Build
Automation using Maven
Auto-Generated Project Documentation
Using maven
q Team communication is an essential part of any
project. And wasting time looking for technical project
information can be costly and frustrating. Clearly, any
IT project will benefit from having its own dedicated
technical Website.
q That's where the Maven site generator steps in. With
little effort, you can have a professional-quality, low
maintenance project Website up and running in no time.
q Documentation is generated by running
§ mvn site
Any Questions ?
Build Automation using Maven
lAbout Me
.about-me{
name: Ankit Gubrani !Sr. AEM Developer;
email-id: ankit.gubrani@codebrains.co.in;
LinkedIn: in.linkedin.com/in/ankitgubrani;
twitter: @ankitgubrani90;
blog: codebrains.blogspot.in;
website : codebrains.co.in;
}
Thank You
Please contact me at : ankit.gubrani@codebrains.co.in
Ad

More Related Content

What's hot (20)

Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
Sandeep Chawla
 
Selenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaSelenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | Edureka
Edureka!
 
Maven tutorial
Maven tutorialMaven tutorial
Maven tutorial
Dragos Balan
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
Anuraj S.L
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
Vijay Krishnan Ramaswamy
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
Cuelogic Technologies Pvt. Ltd.
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
Viyaan Jhiingade
 
Apache maven 2 overview
Apache maven 2 overviewApache maven 2 overview
Apache maven 2 overview
Return on Intelligence
 
Spring boot
Spring bootSpring boot
Spring boot
Gyanendra Yadav
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
Joao Pereira
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Jenkins
JenkinsJenkins
Jenkins
MohanRaviRohitth
 
Jenkins presentation
Jenkins presentationJenkins presentation
Jenkins presentation
Valentin Buryakov
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
Pavan Gupta
 
Spring boot
Spring bootSpring boot
Spring boot
sdeeg
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jiayun Zhou
 
testng
testngtestng
testng
harithakannan
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
BugRaptors
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#
srivinayak
 
Selenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaSelenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | Edureka
Edureka!
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
Anuraj S.L
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
An introduction to Maven
An introduction to MavenAn introduction to Maven
An introduction to Maven
Joao Pereira
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
Pavan Gupta
 
Spring boot
Spring bootSpring boot
Spring boot
sdeeg
 
Jenkins tutorial for beginners
Jenkins tutorial for beginnersJenkins tutorial for beginners
Jenkins tutorial for beginners
BugRaptors
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#
srivinayak
 

Viewers also liked (20)

Apache Maven
Apache MavenApache Maven
Apache Maven
nevjegypartner
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
Geert Pante
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
Mike Desjardins
 
Continuous delivery-with-maven
Continuous delivery-with-mavenContinuous delivery-with-maven
Continuous delivery-with-maven
John Ferguson Smart Limited
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
John Ferguson Smart Limited
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
Sonatype
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
Alan Parkinson
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Nexus FrontierTech
 
Maven overview
Maven overviewMaven overview
Maven overview
Yukti Kaura
 
Maven
Maven Maven
Maven
Khan625
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
Sid Anand
 
Hibernate 3
Hibernate 3Hibernate 3
Hibernate 3
Rajiv Gupta
 
Selenium Test Automation
Selenium Test AutomationSelenium Test Automation
Selenium Test Automation
BabuDevanandam
 
Hibernate
HibernateHibernate
Hibernate
Prashant Kalkar
 
Maven and ANT
Maven and ANTMaven and ANT
Maven and ANT
Sun Technlogies
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3
Matthew McCullough
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
Sunil Dalal
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
Mike McGarr
 
Intro To Hibernate
Intro To HibernateIntro To Hibernate
Intro To Hibernate
Amit Himani
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 
Version Management in Maven
Version Management in MavenVersion Management in Maven
Version Management in Maven
Geert Pante
 
Automated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yardsAutomated Deployment with Maven - going the whole nine yards
Automated Deployment with Maven - going the whole nine yards
John Ferguson Smart Limited
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
Sonatype
 
Continuous Deployment Pipeline with maven
Continuous Deployment Pipeline with mavenContinuous Deployment Pipeline with maven
Continuous Deployment Pipeline with maven
Alan Parkinson
 
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng NghĩaTech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Tech Talk #5 : Code Analysis SonarQube - Lương Trọng Nghĩa
Nexus FrontierTech
 
Hands On with Maven
Hands On with MavenHands On with Maven
Hands On with Maven
Sid Anand
 
Selenium Test Automation
Selenium Test AutomationSelenium Test Automation
Selenium Test Automation
BabuDevanandam
 
Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3Mastering Maven 2.0 In 1 Hour V1.3
Mastering Maven 2.0 In 1 Hour V1.3
Matthew McCullough
 
Continuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applicationsContinuous integration and delivery for java based web applications
Continuous integration and delivery for java based web applications
Sunil Dalal
 
Continuous Delivery
Continuous DeliveryContinuous Delivery
Continuous Delivery
Mike McGarr
 
Intro To Hibernate
Intro To HibernateIntro To Hibernate
Intro To Hibernate
Amit Himani
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
Dzmitry Naskou
 
Ad

Similar to Build Automation using Maven (20)

Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
Dmitry Bakaleinik
 
An Introduction to Maven Part 1
An Introduction to Maven Part 1An Introduction to Maven Part 1
An Introduction to Maven Part 1
MD Sayem Ahmed
 
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
Renato Primavera
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
Maven basics
Maven basicsMaven basics
Maven basics
Vijay Krishnan Ramaswamy
 
Manen Ant SVN
Manen Ant SVNManen Ant SVN
Manen Ant SVN
Sriskandarajah Suhothayan
 
Maven
MavenMaven
Maven
Harshit Choudhary
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Gourav Varma
 
Open Source tools overview
Open Source tools overviewOpen Source tools overview
Open Source tools overview
Luciano Resende
 
Apache ANT vs Apache Maven
Apache ANT vs Apache MavenApache ANT vs Apache Maven
Apache ANT vs Apache Maven
Mudit Gupta
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
venkata20k
 
Maven
MavenMaven
Maven
Nishant Arora
 
Ci jenkins maven svn
Ci jenkins maven svnCi jenkins maven svn
Ci jenkins maven svn
Ankur Goyal
 
Maven
MavenMaven
Maven
Emprovise
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
AnkurSingh656748
 
A-Z_Maven.pdf
A-Z_Maven.pdfA-Z_Maven.pdf
A-Z_Maven.pdf
Mithilesh Singh
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
People Strategists
 
Apache_Maven
Apache_MavenApache_Maven
Apache_Maven
Manasa Adupa
 
Ad

More from Ankit Gubrani (8)

Sling pipes
Sling pipesSling pipes
Sling pipes
Ankit Gubrani
 
Circuit breaker pattern
Circuit breaker patternCircuit breaker pattern
Circuit breaker pattern
Ankit Gubrani
 
Sling models
Sling modelsSling models
Sling models
Ankit Gubrani
 
AEM integration with Apache Mahout
AEM integration with Apache MahoutAEM integration with Apache Mahout
AEM integration with Apache Mahout
Ankit Gubrani
 
Content personalization in AEM
Content personalization in AEMContent personalization in AEM
Content personalization in AEM
Ankit Gubrani
 
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector ToolIntegrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Ankit Gubrani
 
Introduction to Sightly
Introduction to SightlyIntroduction to Sightly
Introduction to Sightly
Ankit Gubrani
 
AEM Client Context Customisation
AEM Client Context CustomisationAEM Client Context Customisation
AEM Client Context Customisation
Ankit Gubrani
 
Circuit breaker pattern
Circuit breaker patternCircuit breaker pattern
Circuit breaker pattern
Ankit Gubrani
 
AEM integration with Apache Mahout
AEM integration with Apache MahoutAEM integration with Apache Mahout
AEM integration with Apache Mahout
Ankit Gubrani
 
Content personalization in AEM
Content personalization in AEMContent personalization in AEM
Content personalization in AEM
Ankit Gubrani
 
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector ToolIntegrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Integrating Apache Wookie with AEM || AEM-Wookie Connector Tool
Ankit Gubrani
 
Introduction to Sightly
Introduction to SightlyIntroduction to Sightly
Introduction to Sightly
Ankit Gubrani
 
AEM Client Context Customisation
AEM Client Context CustomisationAEM Client Context Customisation
AEM Client Context Customisation
Ankit Gubrani
 

Recently uploaded (20)

Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Mastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core PillarsMastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core Pillars
Marcel David
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Agentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM modelsAgentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM models
Manish Chopra
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Shift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software DevelopmentShift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software Development
SathyaShankar6
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Xforce Keygen 64-bit AutoCAD 2025 Crack
Xforce Keygen 64-bit AutoCAD 2025  CrackXforce Keygen 64-bit AutoCAD 2025  Crack
Xforce Keygen 64-bit AutoCAD 2025 Crack
usmanhidray
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Solidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license codeSolidworks Crack 2025 latest new + license code
Solidworks Crack 2025 latest new + license code
aneelaramzan63
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Mastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core PillarsMastering OOP: Understanding the Four Core Pillars
Mastering OOP: Understanding the Four Core Pillars
Marcel David
 
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Proactive Vulnerability Detection in Source Code Using Graph Neural Networks:...
Ranjan Baisak
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Agentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM modelsAgentic AI Use Cases using GenAI LLM models
Agentic AI Use Cases using GenAI LLM models
Manish Chopra
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
How Valletta helped healthcare SaaS to transform QA and compliance to grow wi...
Egor Kaleynik
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Sales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptxSales Deck SentinelOne Singularity Platform.pptx
Sales Deck SentinelOne Singularity Platform.pptx
EliandoLawnote
 
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
How to Batch Export Lotus Notes NSF Emails to Outlook PST Easily?
steaveroggers
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Shift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software DevelopmentShift Left using Lean for Agile Software Development
Shift Left using Lean for Agile Software Development
SathyaShankar6
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
The Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdfThe Significance of Hardware in Information Systems.pdf
The Significance of Hardware in Information Systems.pdf
drewplanas10
 
Xforce Keygen 64-bit AutoCAD 2025 Crack
Xforce Keygen 64-bit AutoCAD 2025  CrackXforce Keygen 64-bit AutoCAD 2025  Crack
Xforce Keygen 64-bit AutoCAD 2025 Crack
usmanhidray
 

Build Automation using Maven

  • 1. Build Automation With maven (By Ankit Gubrani)
  • 2. Agenda q What is maven? q Why maven? q Maven Installation. q How maven works. q The build Lifecycle. q Basics of POM, Profiles, Repositories. q Maven Plugins. q Maven Dependency. q Creating custom maven Plugin.
  • 5. Ok but before that ! What is a build tool?
  • 6. Build Tool q A build tool is a programming utility that is used when building a new version of a program. q Build tools are tools to manage and organise your builds.
  • 8. Now that you know What Build Tool is. Here is Maven -
  • 9. Maven q Maven is a popular open source build tool used primarily for Java projects. It was designed to make build process easier task. q Apart from being a build tool Maven can also manage reporting and documentation from a central piece of information. q It is based on the concept of a project object model (POM). q Maven is more than just a "build tool" rather is a project management tool.
  • 10. Maven provides developers ways to manage following: q Builds q Documentation q Reporting q Dependencies q SCMs q Releases q Distribution q Mailing list
  • 11. Why Maven if we have other Build tools available ???
  • 12. Comparison Here are some of the benefits of using Maven over any other build (Ant, make etc) : q Standardized project layout. (Convention over configuration unlike ANT) q Automatic dependency handling.(Ant can't do this unassisted) q Large Existing repository. q Reusability ( through Maven Plugins).
  • 14. Installation q Maven is a Java tool, so you must have Java installed in order to proceed. q Follow the instructions on the link for intallation : http://maven.apache.org/download.cgi#Installatio n q Once installation is done type the following command in a terminal or in a command prompt: mvn –version It should print out your installed version of Maven
  • 17. Lifecycle q Build Lifecycle is a well defined sequence of phases which define the order in which the goals are to be executed. Here phase represents a stage in life cycle. q When Maven starts building a project, it steps through a defined sequence of phases and executes goals which are registered with each phase. Maven has following three standard lifecycles: q Clean q default(or build) q Site
  • 18. q A Build Lifecycle is Made Up of Phases. q A Build Phase is Made Up of Plugin Goals. q A Plugin Goal represents a specific task (finer than a build phase) which contributes to the building and managing of a project.
  • 20. POM
  • 21. lProject Object Model q POM stands for Project Object Model. It is fundamental Unit of work in Maven. q It is an XML file. It always resides in the base directory of the project as pom.xml. q The POM contains information about the project and various configuration detail used by Maven to build the project.
  • 22. lSome of the configuration that can be specified in the POM are following: q project dependencies q plugins q goals q build profiles q project version q developers q mailing list
  • 24. q A maven repository is a directory of packaged JAR file with pom.xml file. Maven searches for dependencies in the repositories. There are 3 types of maven repostory : § Local Repository § Central Repository § Remote Repository q Maven searches for the dependencies in the following order: q Local repository then Central repository then Remote repository.
  • 25. q Local Repository :- § Maven local repository is located in your local system. It is created by the maven when you run any maven command. § By default, maven local repository is %USER_HOME%/.m2 directory. For example: C:UsersSSS IT.m2. q Central Repository :- § Maven central repository is located on the web. It has been created by the apache maven community itself. § The path of central repository is: http://repo1.maven.org/maven2 .
  • 26. q Remote Repository :- § Maven remote repository is located on the web. Most of libraries can be missing from the central repository such as JBoss library etc, so we need to define remote repository in pom.xml file.
  • 28. q A Build profile is a set of configuration values which can be used to set or override default values of Maven build. Using a build profile, you can customize build for different environments such as Production v/s Development environments. q Build profiles are majorly of three types : § Per Project :- Defined in the project POM file, pom.xml § Per User :- Defined in Maven settings xml file (%USER_HOME%/.m2/settings.xml) § Global :- Defined in Maven global settings xml file (%M2_HOME%/conf/settings.xml)
  • 30. q Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. q Maven is actually a plugin execution framework where every task is actually done by plugins. q A plugin generally provides a set of goals and which can be executed using following syntax: ü mvn [plugin-name]:[goal-name] q There are plugins for almost every task in maven like plugins are used to: create jar files, create war files, compile code, unit test code, create project documentation, and on and on.
  • 31. q Maven provides following two types of Plugins: 1)Build plugins:- They execute during the build and should be configured in the <build/> element of pom.xml . 2)Reporting plugins:-They execute during the site generation and they should be configured in the <reporting/> element of the pom.xml .
  • 33. lAn archetype is defined as an original pattern or model from which all other things of the same kind are made. lMaven provides users,a very large list of different types of project templates using concept of Archetype. Maven helps users to quickly start a new java project using following command : mvn archetype:generate lArchetype is a Maven plugin whose task is to create a project structure as per its template. Archetype Plugin allows the user to create a Maven project from an existing template called an archetype. Archetype
  • 34. Now that you know basics of maven, Let's create a maven project
  • 35. q For creating any project maven provides templates(Archetype), using which one can create by selecting any one archetype from available archetypes. q To start a new Maven project, use the Maven Archetype plugin from the command line. Run the following command :- § mvn archetype:generate -DarchetypeGroupId=[Group Id] - DarchetypeArtifactId= [Artifact ID] q You can search for all archetypes provided by maven at there central repository (http://search.maven.org/) and all other 3rd party archetypes at any remote repository like - http://mvnrepository.com
  • 36. Demo
  • 38. q SNAPSHOT is a special version that indicates a current development copy. q Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository for every build. q Snapshot vs Version :- q In case of Version, if Maven once downloaded the mentioned version say data-service:1.0, it will never try to download a newer 1.0 available in repository. To download the updated code, artifact version is be upgraded to 1.1. q In case of SNAPSHOT, Maven will automatically fetch the latest SNAPSHOT (data-service:1.0-SNAPSHOT) everytime app-ui team build their project.
  • 39. Hey did you notice ??? What we did till now automated the build process. And this is called Build Automation using Maven
  • 41. q Team communication is an essential part of any project. And wasting time looking for technical project information can be costly and frustrating. Clearly, any IT project will benefit from having its own dedicated technical Website. q That's where the Maven site generator steps in. With little effort, you can have a professional-quality, low maintenance project Website up and running in no time. q Documentation is generated by running § mvn site
  • 44. lAbout Me .about-me{ name: Ankit Gubrani !Sr. AEM Developer; email-id: [email protected]; LinkedIn: in.linkedin.com/in/ankitgubrani; twitter: @ankitgubrani90; blog: codebrains.blogspot.in; website : codebrains.co.in; }