SlideShare a Scribd company logo
CI Using Jenkins, Maven & SVN
Ankur Goyal
Email: ankur.fbd@gmail.com
Agenda
• Java Build Process
• Continuous Integration
 Introduction
 Tools
• SVN - Apache Subversion
• Maven
 Introduction
 The Philosophy
 Build Patterns
 Common Project Metadata Format
 Common Directory Structure
 Common Build Lifecycle
 Dependency Management
 Repository
 Phases & Goals
 Hands-on
• Jenkins
• Continuous Integration – Team’s Responsibilities
Java Build Process
• "Build" is a process that covers all the steps required to create a
"deliverable" of your software.
• In the Java world, this typically includes:
 Generating sources (sometimes).
 Compiling sources.
 Compiling test sources.
 Executing tests (unit tests, integration tests, etc).
 Packaging (into jar, war).
 Running health checks (static analyzers like Checkstyle, Findbugs, PMD, test
coverage, etc).
 Generating reports.
Continuous Integration - Introduction
• Continuous Integration (CI) is a development practice that requires
developers to
integrate code into a shared repository several times a day. Each
check-in is then
verified by an automated build, allowing teams to detect problems
early.
• CI Best Practices:
 Maintain a single source repository
 Automate the build
 Make your build self-testing
 Every commit should build on an integration machine
 Automate deployment
Continuous Integration – Process Overview
http://builtbyadam.files.wordpress.com/2010/06/ci-diagram.png
Continuous Integration – Why ?
• Integration of various modules at the end is hard due to following
reasons:
 Number of components keep increasing
 Complexity of the system keeps increasing
 There is no visibility of code quality & relationship between different
modules
• CI provides following benefits:
 Rapid Feedback - Detects system development problems in initial stage
 Reduces risk of cost & schedule
 Reduces rework
 Provides report so that one can judge the actual code quality
 Collective Ownership
Continuous Integration - Tools
• Source Repository
SVN, CVS, GIT etc
• Build Tool
Maven, ANT etc
• CI Server
Jenkins, Hudson etc
SVN – Apache Subversion
• Apache Subversion is a software versioning and revision control system
• Distributed as free software under the Apache License.
• Is Open Source.
• Runs on Unix, Linux, Windows, Mac
• Client’s such as TortoiseSVN are available which provide intuitive and easy
to use
interface
• Developers use Subversion to maintain current and historical versions of
files
such as source code, web pages, and documentation.
Maven - Introduction
• Is a Java build tool.
• Is a dependency management tool
• Provides a standard development infrastructure across
projects
• Consistent project structure & build model
• Follows standard project life cycle phases & ensures that
developers moving
between projects do not need to learn new processes.
Maven - Nomenclature
• Archetype: template based on which maven
project would be created e.g.:
org.apache.maven.archetypes:maven-archetype-quickstart
(An archetype which contains a sample Maven project.)
• Groupid: similar to package in java e.g:
com.endeavour.first
• Artifactid: similar to project name in java e.g:
Maven-sample
Maven – Why ?
• Project references/dependencies
Make sure jars are available during compile time
Make sure to copy jars when moving project source
• Dependencies
Include dependencies of included jars
• Project Structure
Defines a standard project structure
• Publishing & Deploying
Allows phase-wise publishing & deployment
Maven – The Philosophy
• Maven was born of the very practical desire to make several projects at
Apache work in the same way. So that developers could freely move between
these
projects, knowing clearly how they all worked by understanding how one of
them worked.
• Puts convention over configuration
• Do not script the build rather describe the project & configure the build
• Defines Build Patterns
 Common Project Metadata Format
 Common Directory Structure
 Common Build lifecycles
Build Patterns – Common Project Metadata Format
• POM  Project Object Model
 Pom.xml  Project configuration file
• Contains all metadata about the
project:
 Name
 Packaging Type
 Dependencies
 Repositories to use
 Tool links (CI, SCM, Bug Tracker etc)
Build Patterns – Common Directory Structure
• Maven is opinionated about project structure & follows
convention over configuration approach.
• Following is standard directory layout:
 target: Default work directory
 src: All project source files go in this directory
 src/main: All sources that go into primary artifact
 src/test: All sources contributing to testing project
 src/main/java: All java source files
 src/main/webapp: All web source files
 src/main/resources: All non compiled source files
 src/test/java: All java test source files
 src/test/resources: All non compiled test source files
Build Patterns – Common Build Lifecycle
• Default Lifecycle phases - Invoked with ‘mvn’ command
 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 e.g. junit
 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 (Not server
install)
 deploy - copies the final package to the remote repository for sharing with other developers and projects (Not
server deploy)
• There are two other Maven lifecycles of note beyond the default list above:
 clean: cleans up artifacts created by prior builds
 site: generates site documentation for this project
Specify the phase needed to run, previous phases run automatically
Maven – Dependency Management
• Dependencies Identified by
groupid
artifactid
version
scope
• Declaration in pom.xml will do the following:
download the jar
add it to the classpath
• Supports Transitive dependencies
Automatically takes care of dependencies of dependencies
Maven - Repository
• Contains versioned artifacts & plugins associated with
pom
• No need to copy libraries for each individual project
• Remote repository can be added as required
• Local repository caches artifacts to allow offline builds
• All project references go through the repository
therefore no relative paths
Maven – Phases & Goals
• Goals are executed in phases. Phases determine the order of goal’s
execution.
• The compile phase goals will always be executed before the test
phase goals which
will always be executed before the package phase goals and so on…
• When executing maven we can specify a goal or a phase, however If
you specify a
goal then it will still run all phases up to the phase for that goal. In
other words,
if you specify the jar goal it will run all phases up to the package phase
(and all goals in those phases), and then it will run the jar goal.
Phase Goal
compile compiler:compile
test-compile compiler:testCompile
package jar:jar or rar:rar or war:war
Maven – Hands-on
• Install & Configure Maven
mvn --version
• Create a Maven Project that outputs a jar
mvn archetype:generate
• Add a dependency in project created above
▌Resources:
 http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
 http://www.mkyong.com/tutorials/maven-tutorials/
 https://www.youtube.com/watch?v=al7bRZzz4oU
Jenkins - Introduction
• An open source CI server
• Easy To Install and use
• Formerly known as Hudson
• Triggers a build based on some event such as notice SVN
commit or manually click build by user or build periodically.
• Generates reports & notify to team as configured
• Deploys the deliverable at given server
Jenkins - Why
• Easy GUI to Manage
• Strong Community
• Distributed Builds
• Open Source and Free
Used by leading organizations
Jenkins – Basic Steps
• Notice a change
• Checkout source code
• Execute builds/test
• Record and Publish results
• Notify Team
Integrating Plugins
• Jenkins is extensible & we can add new capabilities using
plugins
• Over 600 plugins are available for Jenkins such as:
 Static code analyzers
 Test coverage
 Reporting plugins
 Credentials Management
 Mailer etc
• Use Manage Plugin section for integrating plugins
Integrating Plugins – Code Quality
• Install PMD, FindBugs and checkstyle plugins from the
manage plugins option.
• Add cobertura plugin to capture the code coverage report by
Junit.
• Add the plugins in the pom.xml file of the project.
• Configure the jenkins job to process the above tools.
• Install the plugins to display the violations on the jenkins
dashboard like-
 Analysis Collector Plugin, Violations, Dashboard View, Plot Plugin.
• Set goal: Cobertura:cobertura check pmd:pmd
findbug:findbug in Jenkins Job.
• Execute the build.
Continuous Integration – Team’s Responsibilities
• Check in frequently
• Don’t check in broken code
• Don’t check in untested code
• Don’t check in when the build is broken
• After checking in make sure that system builds successfully
Thank You & Happy CI !!!
Ad

More Related Content

What's hot (20)

Continuous delivery-with-maven
Continuous delivery-with-mavenContinuous delivery-with-maven
Continuous delivery-with-maven
John Ferguson Smart Limited
 
Jenkins
JenkinsJenkins
Jenkins
Roger Xia
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
Knoldus Inc.
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
amscanne
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
Gourav Varma
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Slawa Giterman
 
Continuous Delivery Using Jenkins
Continuous Delivery Using JenkinsContinuous Delivery Using Jenkins
Continuous Delivery Using Jenkins
Cliffano Subagio
 
Continuous integration with Jenkins
Continuous integration with JenkinsContinuous integration with Jenkins
Continuous integration with Jenkins
Mohammad Hossein Rimaz
 
Jenkins CI
Jenkins CIJenkins CI
Jenkins CI
haochenglee
 
Continuous integration / deployment with Jenkins
Continuous integration / deployment with JenkinsContinuous integration / deployment with Jenkins
Continuous integration / deployment with Jenkins
cherryhillco
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Introduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsIntroduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with Jenkins
Brice Argenson
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Jenkins tutorial
Jenkins tutorialJenkins tutorial
Jenkins tutorial
HarikaReddy115
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
Pavan Gupta
 
Jenkins-CI
Jenkins-CIJenkins-CI
Jenkins-CI
Gong Haibing
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Robert McDermott
 
JENKINS Training
JENKINS TrainingJENKINS Training
JENKINS Training
Nithin Kumar
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
Edureka!
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
Knoldus Inc.
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
amscanne
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
Gourav Varma
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Slawa Giterman
 
Continuous Delivery Using Jenkins
Continuous Delivery Using JenkinsContinuous Delivery Using Jenkins
Continuous Delivery Using Jenkins
Cliffano Subagio
 
Continuous integration / deployment with Jenkins
Continuous integration / deployment with JenkinsContinuous integration / deployment with Jenkins
Continuous integration / deployment with Jenkins
cherryhillco
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
Troublemaker Khunpech
 
Introduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsIntroduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with Jenkins
Brice Argenson
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Jenkins Introduction
Jenkins IntroductionJenkins Introduction
Jenkins Introduction
Pavan Gupta
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Robert McDermott
 
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | EdurekaWhat is Jenkins | Jenkins Tutorial for Beginners | Edureka
What is Jenkins | Jenkins Tutorial for Beginners | Edureka
Edureka!
 
An Introduction To Jenkins
An Introduction To JenkinsAn Introduction To Jenkins
An Introduction To Jenkins
Knoldus Inc.
 

Viewers also liked (20)

Introduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsIntroduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with Jenkins
Eric Hogue
 
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryJenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous Delivery
Virendra Bhalothia
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
OpenCms Module Development & Deployment with IntelliJ, Maven and Jenkins
OpenCms Module Development & Deployment with IntelliJ, Maven and JenkinsOpenCms Module Development & Deployment with IntelliJ, Maven and Jenkins
OpenCms Module Development & Deployment with IntelliJ, Maven and Jenkins
mediaworx berlin AG
 
Git for beginners
Git for beginnersGit for beginners
Git for beginners
Arulmurugan Rajaraman
 
Selenium
SeleniumSelenium
Selenium
Andrew Johnstone
 
Selenium Camp 2016
Selenium Camp 2016Selenium Camp 2016
Selenium Camp 2016
Dan Cuellar
 
Git tutorial
Git tutorial Git tutorial
Git tutorial
TingYen Lee
 
Software Testing
Software TestingSoftware Testing
Software Testing
Abhishek Saxena
 
Trac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイル
Trac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイルTrac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイル
Trac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイル
Shuji Watanabe
 
Juc west-how to build a jenkins db the wrong way!
Juc west-how to build a jenkins db the wrong way!Juc west-how to build a jenkins db the wrong way!
Juc west-how to build a jenkins db the wrong way!
Michael Barbine
 
Los vatos
Los vatosLos vatos
Los vatos
losvatoslocos
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
KMS Technology
 
Jenkins Workflow - An Introduction
Jenkins Workflow - An IntroductionJenkins Workflow - An Introduction
Jenkins Workflow - An Introduction
Ben Snape
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
Sandeep Chawla
 
20160929 android taipei Sonatype nexus on amazon ec2
20160929 android taipei Sonatype nexus on amazon ec2 20160929 android taipei Sonatype nexus on amazon ec2
20160929 android taipei Sonatype nexus on amazon ec2
TSE-JU LIN(Louis)
 
Protractor overview
Protractor overviewProtractor overview
Protractor overview
Abhishek Yadav
 
Protractor training
Protractor trainingProtractor training
Protractor training
Sergiy Stotskiy
 
Using Jenkins XML API
Using Jenkins XML APIUsing Jenkins XML API
Using Jenkins XML API
Anton Weiss
 
DevOps – SonarQube
DevOps – SonarQubeDevOps – SonarQube
DevOps – SonarQube
Delta-N
 
Introduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with JenkinsIntroduction to Continuous Integration with Jenkins
Introduction to Continuous Integration with Jenkins
Eric Hogue
 
Jenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous DeliveryJenkins - From Continuous Integration to Continuous Delivery
Jenkins - From Continuous Integration to Continuous Delivery
Virendra Bhalothia
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
HubSpot
 
OpenCms Module Development & Deployment with IntelliJ, Maven and Jenkins
OpenCms Module Development & Deployment with IntelliJ, Maven and JenkinsOpenCms Module Development & Deployment with IntelliJ, Maven and Jenkins
OpenCms Module Development & Deployment with IntelliJ, Maven and Jenkins
mediaworx berlin AG
 
Selenium Camp 2016
Selenium Camp 2016Selenium Camp 2016
Selenium Camp 2016
Dan Cuellar
 
Trac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイル
Trac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイルTrac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイル
Trac/Subversion/JUnit/Maven/Jenkinsで構築する開発スタイル
Shuji Watanabe
 
Juc west-how to build a jenkins db the wrong way!
Juc west-how to build a jenkins db the wrong way!Juc west-how to build a jenkins db the wrong way!
Juc west-how to build a jenkins db the wrong way!
Michael Barbine
 
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
Behavior-Driven Development and Automation Testing Using Cucumber Framework W...
KMS Technology
 
Jenkins Workflow - An Introduction
Jenkins Workflow - An IntroductionJenkins Workflow - An Introduction
Jenkins Workflow - An Introduction
Ben Snape
 
20160929 android taipei Sonatype nexus on amazon ec2
20160929 android taipei Sonatype nexus on amazon ec2 20160929 android taipei Sonatype nexus on amazon ec2
20160929 android taipei Sonatype nexus on amazon ec2
TSE-JU LIN(Louis)
 
Using Jenkins XML API
Using Jenkins XML APIUsing Jenkins XML API
Using Jenkins XML API
Anton Weiss
 
DevOps – SonarQube
DevOps – SonarQubeDevOps – SonarQube
DevOps – SonarQube
Delta-N
 
Ad

Similar to Ci jenkins maven svn (20)

Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
Gourav Varma
 
Introduction tomaven
Introduction tomavenIntroduction tomaven
Introduction tomaven
Manav Prasad
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Session 2
Session 2Session 2
Session 2
gayathiry
 
Jenkins an opensource CICD platform for all
Jenkins an opensource CICD platform for allJenkins an opensource CICD platform for all
Jenkins an opensource CICD platform for all
ssuserd7cedc
 
Mavennotes.pdf
Mavennotes.pdfMavennotes.pdf
Mavennotes.pdf
AnkurSingh656748
 
Apache Maven
Apache MavenApache Maven
Apache Maven
eurosigdoc acm
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
venkata20k
 
Jenkins.pdf
Jenkins.pdfJenkins.pdf
Jenkins.pdf
326KUBAVATHARSHALBHA
 
Learning Maven by Example
Learning Maven by ExampleLearning Maven by Example
Learning Maven by Example
Hsi-Kai Wang
 
Jenkins_1679702972.pdf
Jenkins_1679702972.pdfJenkins_1679702972.pdf
Jenkins_1679702972.pdf
MahmoudAlnmr1
 
jenkins.pdf
jenkins.pdfjenkins.pdf
jenkins.pdf
shahidafrith
 
Java build tools
Java build toolsJava build tools
Java build tools
Sujit Kumar
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
Geff Henderson Chang
 
Introduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOpsIntroduction to Maven for beginners and DevOps
Introduction to Maven for beginners and DevOps
SISTechnologies
 
Contineous integration
Contineous integrationContineous integration
Contineous integration
Radhakrishna Mutthoju
 
Devops
DevopsDevops
Devops
JyothirmaiG4
 
Maven 3 Overview
Maven 3  OverviewMaven 3  Overview
Maven 3 Overview
Mike Ensor
 
Build tool
Build toolBuild tool
Build tool
Mallikarjuna G D
 
Ad

Recently uploaded (20)

EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
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
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
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
 
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
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
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
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
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
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
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
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
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
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
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
 
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
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)Who Watches the Watchmen (SciFiDevCon 2025)
Who Watches the Watchmen (SciFiDevCon 2025)
Allon Mureinik
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
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
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
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
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
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
 
WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)WinRAR Crack for Windows (100% Working 2025)
WinRAR Crack for Windows (100% Working 2025)
sh607827
 

Ci jenkins maven svn

  • 1. CI Using Jenkins, Maven & SVN Ankur Goyal Email: [email protected]
  • 2. Agenda • Java Build Process • Continuous Integration  Introduction  Tools • SVN - Apache Subversion • Maven  Introduction  The Philosophy  Build Patterns  Common Project Metadata Format  Common Directory Structure  Common Build Lifecycle  Dependency Management  Repository  Phases & Goals  Hands-on • Jenkins • Continuous Integration – Team’s Responsibilities
  • 3. Java Build Process • "Build" is a process that covers all the steps required to create a "deliverable" of your software. • In the Java world, this typically includes:  Generating sources (sometimes).  Compiling sources.  Compiling test sources.  Executing tests (unit tests, integration tests, etc).  Packaging (into jar, war).  Running health checks (static analyzers like Checkstyle, Findbugs, PMD, test coverage, etc).  Generating reports.
  • 4. Continuous Integration - Introduction • Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early. • CI Best Practices:  Maintain a single source repository  Automate the build  Make your build self-testing  Every commit should build on an integration machine  Automate deployment
  • 5. Continuous Integration – Process Overview http://builtbyadam.files.wordpress.com/2010/06/ci-diagram.png
  • 6. Continuous Integration – Why ? • Integration of various modules at the end is hard due to following reasons:  Number of components keep increasing  Complexity of the system keeps increasing  There is no visibility of code quality & relationship between different modules • CI provides following benefits:  Rapid Feedback - Detects system development problems in initial stage  Reduces risk of cost & schedule  Reduces rework  Provides report so that one can judge the actual code quality  Collective Ownership
  • 7. Continuous Integration - Tools • Source Repository SVN, CVS, GIT etc • Build Tool Maven, ANT etc • CI Server Jenkins, Hudson etc
  • 8. SVN – Apache Subversion • Apache Subversion is a software versioning and revision control system • Distributed as free software under the Apache License. • Is Open Source. • Runs on Unix, Linux, Windows, Mac • Client’s such as TortoiseSVN are available which provide intuitive and easy to use interface • Developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation.
  • 9. Maven - Introduction • Is a Java build tool. • Is a dependency management tool • Provides a standard development infrastructure across projects • Consistent project structure & build model • Follows standard project life cycle phases & ensures that developers moving between projects do not need to learn new processes.
  • 10. Maven - Nomenclature • Archetype: template based on which maven project would be created e.g.: org.apache.maven.archetypes:maven-archetype-quickstart (An archetype which contains a sample Maven project.) • Groupid: similar to package in java e.g: com.endeavour.first • Artifactid: similar to project name in java e.g: Maven-sample
  • 11. Maven – Why ? • Project references/dependencies Make sure jars are available during compile time Make sure to copy jars when moving project source • Dependencies Include dependencies of included jars • Project Structure Defines a standard project structure • Publishing & Deploying Allows phase-wise publishing & deployment
  • 12. Maven – The Philosophy • Maven was born of the very practical desire to make several projects at Apache work in the same way. So that developers could freely move between these projects, knowing clearly how they all worked by understanding how one of them worked. • Puts convention over configuration • Do not script the build rather describe the project & configure the build • Defines Build Patterns  Common Project Metadata Format  Common Directory Structure  Common Build lifecycles
  • 13. Build Patterns – Common Project Metadata Format • POM  Project Object Model  Pom.xml  Project configuration file • Contains all metadata about the project:  Name  Packaging Type  Dependencies  Repositories to use  Tool links (CI, SCM, Bug Tracker etc)
  • 14. Build Patterns – Common Directory Structure • Maven is opinionated about project structure & follows convention over configuration approach. • Following is standard directory layout:  target: Default work directory  src: All project source files go in this directory  src/main: All sources that go into primary artifact  src/test: All sources contributing to testing project  src/main/java: All java source files  src/main/webapp: All web source files  src/main/resources: All non compiled source files  src/test/java: All java test source files  src/test/resources: All non compiled test source files
  • 15. Build Patterns – Common Build Lifecycle • Default Lifecycle phases - Invoked with ‘mvn’ command  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 e.g. junit  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 (Not server install)  deploy - copies the final package to the remote repository for sharing with other developers and projects (Not server deploy) • There are two other Maven lifecycles of note beyond the default list above:  clean: cleans up artifacts created by prior builds  site: generates site documentation for this project Specify the phase needed to run, previous phases run automatically
  • 16. Maven – Dependency Management • Dependencies Identified by groupid artifactid version scope • Declaration in pom.xml will do the following: download the jar add it to the classpath • Supports Transitive dependencies Automatically takes care of dependencies of dependencies
  • 17. Maven - Repository • Contains versioned artifacts & plugins associated with pom • No need to copy libraries for each individual project • Remote repository can be added as required • Local repository caches artifacts to allow offline builds • All project references go through the repository therefore no relative paths
  • 18. Maven – Phases & Goals • Goals are executed in phases. Phases determine the order of goal’s execution. • The compile phase goals will always be executed before the test phase goals which will always be executed before the package phase goals and so on… • When executing maven we can specify a goal or a phase, however If you specify a goal then it will still run all phases up to the phase for that goal. In other words, if you specify the jar goal it will run all phases up to the package phase (and all goals in those phases), and then it will run the jar goal. Phase Goal compile compiler:compile test-compile compiler:testCompile package jar:jar or rar:rar or war:war
  • 19. Maven – Hands-on • Install & Configure Maven mvn --version • Create a Maven Project that outputs a jar mvn archetype:generate • Add a dependency in project created above ▌Resources:  http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html  http://www.mkyong.com/tutorials/maven-tutorials/  https://www.youtube.com/watch?v=al7bRZzz4oU
  • 20. Jenkins - Introduction • An open source CI server • Easy To Install and use • Formerly known as Hudson • Triggers a build based on some event such as notice SVN commit or manually click build by user or build periodically. • Generates reports & notify to team as configured • Deploys the deliverable at given server
  • 21. Jenkins - Why • Easy GUI to Manage • Strong Community • Distributed Builds • Open Source and Free Used by leading organizations
  • 22. Jenkins – Basic Steps • Notice a change • Checkout source code • Execute builds/test • Record and Publish results • Notify Team
  • 23. Integrating Plugins • Jenkins is extensible & we can add new capabilities using plugins • Over 600 plugins are available for Jenkins such as:  Static code analyzers  Test coverage  Reporting plugins  Credentials Management  Mailer etc • Use Manage Plugin section for integrating plugins
  • 24. Integrating Plugins – Code Quality • Install PMD, FindBugs and checkstyle plugins from the manage plugins option. • Add cobertura plugin to capture the code coverage report by Junit. • Add the plugins in the pom.xml file of the project. • Configure the jenkins job to process the above tools. • Install the plugins to display the violations on the jenkins dashboard like-  Analysis Collector Plugin, Violations, Dashboard View, Plot Plugin. • Set goal: Cobertura:cobertura check pmd:pmd findbug:findbug in Jenkins Job. • Execute the build.
  • 25. Continuous Integration – Team’s Responsibilities • Check in frequently • Don’t check in broken code • Don’t check in untested code • Don’t check in when the build is broken • After checking in make sure that system builds successfully
  • 26. Thank You & Happy CI !!!