SlideShare a Scribd company logo
By:
- Abdullah Ibrahim Salama
- Muhammad Abdul-Fattah Abulmajd
Agenda
 What’s a Build Tool
 Advantages of Build Automation
 What’s Maven
 Objectives
 Features
 Helps To Manage
 Why Maven Not Ant
 Gradle – A New Sheriff In Town
 Continuous Integration
 Why Continuous Integration
 Workflow
 Benefits
 What’s Jenkins
 Jenkins and Hudson
 Build Life Cycles, Phases, and Goals
 Plug-ins
 POM File
 What’s POM File
 POM File Example
 POM File Minimal Requirements
 Super POM File
 Further Readings
2
What’s a Build Tool
 Generating source code (if auto-generated code is used in
the project).
 Generating documentation from the source code.
 Compiling source code.
 Packaging compiled code into JAR files or ZIP files.
 Installing the packaged code on a server, in a repository or
somewhere else.
3
Advantages of Build Automation
 A necessary pre-condition for continuous integration (CI) and
continuous testing.
 Improve product quality.
 Accelerate the compile and link processing.
 Eliminate redundant tasks.
 Minimize "bad builds".
 Eliminate dependencies on key personnel.
 Minimize the risk of humans making errors while building the
software manually.
 Have history of builds and releases in order to investigate issues.
 Save time and money - because of the reasons listed above.
4
What’s Maven
 Maven is a powerful project management tool that is based
on POM (Project Object Model). It is used for projects build,
dependency and documentation.
 Maven was released in 2004. Its goal was to improve upon
some of the problems developers were facing when using Ant.
 Maven simplifies and standardizes the project build process.
 Maven increases reusability and takes care of most of the
build related tasks.
5
Objectives
 Maven’s primary goal is to allow a developer to comprehend
the complete state of a development effort in the shortest
period of time. In order to attain this goal there are several
areas of concern that Maven attempts to deal with:
 Making the build process easy
 While using Maven doesn’t eliminate the need to know about the
underlying mechanisms, Maven does provide a lot of shielding
from the details.
 Providing a uniform build system
 Maven allows a project to build using its project object model
(POM) and a set of plugins that are shared by all projects using
Maven, providing a uniform build system.
6
Objectives
 Providing quality project information and reporting
 Maven provides plenty of useful project information that is in
part taken from your POM and in part generated from your
project’s sources. For example, Maven can provide:
 log document,
 cross referenced sources,
 dependency list,
 unit test reports, and etc.
 Easy to migrate for new features of Maven
7
Objectives
 Providing guidelines for best practices development
 Maven aims to gather current principles for best practices development, and make it easy
to guide a project in that direction.
 For example, specification, execution, and reporting of unit tests are part of the normal
build cycle using Maven. Current unit testing best practices were used as guidelines:
 Keeping your test source code in a separate, but parallel source tree
 Using test case naming conventions to locate and execute tests
 Have test cases setup their environment and don’t rely on customizing the build for
test preparation.
 Maven also aims to assist in project workflow such as release management and
issue tracking.
 Maven also suggests some guidelines on how to layout your project’s directory
structure so that once you learn the layout you can easily navigate any other
project that uses Maven and the same defaults.
8
Features
 Simple project setup that follows
best practices.
 Consistent usage across all projects.
 Dependency management including
automatic updating.
 A large and growing repository of
libraries.
 Extensible, with the ability to easily
write plugins in Java or scripting
languages.
 Instant access to new features with
little or no extra configuration.
 Backward Compatibility
 Model-based builds − Maven is able
to build any number of projects into
predefined output types such as jar,
war, metadata.
 Coherent site of project information
 Using the same metadata as per the
build process, maven is able to
generate a website and a PDF
including complete documentation.
 Release management and
distribution publication
 Better Error and Integrity Reporting
9
Helps To Manage
 Builds
 Documentation
 Reporting
 Dependencies
 Including automatic updating
 SCMs
 Releases
 Distribution
10
Why Maven Not Ant
 Main difference is that in ANT you need to
define every thing i.e source dir, build dir,
target and etc. While Maven adopts
principle of Convention over Configuration.
 CoC results in
 Little/no configuration
 Following pre-scripted conventions
 Reasonable defaults
 Override when required
 Which means Maven has predefined project
structure i.e standard directory for source
files, test files and resources etc. 11
Why Maven Not Ant
 Maven introduced concept of repository, which is a central place to store all
libraries, JARs etc. Maven allows you to use central maven repository (remote) as
well as local repository and automatically download dependency during build
process.
 The local repository is a folder inside the machine in which a project is being
developed, acting as a cache with respect to the remote repositories.
 Apache provides a central repository containing thousands of common
dependencies, which is the default one.
 Maven does not rely on this specific repository, thus allowing users to define their
own custom repositories.
 While ANT based project generally use ${lib} as directory to store dependencies.
Manual dependency management.
 Changing and updating dependency is much easier in maven than ANT because you
don't need to manually download dependency. Having an organization wide central
repository also helps to remove redundancy across different projects.
12
Why Maven Not Ant
 Maven provides a uniform interface for building projects. You can build a
Maven project by using just a handful of commands. All you need to do is
download the project and run mvn install to build it.
 Also by knowing maven conventions and looking at pom.xml, one can easily
understand where source files are and what are project dependencies.
 ANT doesn't have any lifecycle, you need to define targets and there
dependencies. While Maven has lifecycle, which is invoked when you run
commands like mvn install. Maven executes a series of steps as a result of this
command to produce artifacts e.g. JAR file, which is end of life cycle
 Inheritance: This concept simply means that everything that is not specified in
a POM file is inherited from the upper-level POM.
 At the top level, Maven provides a parent POM defining all default
values.
13
Gradle – A New Sheriff In Town
 An open-source, build automation system, released in 2012, that
builds upon the concepts of Ant and Maven
 Has all advantages of Maven plus Ant flexibility.
 Google chose Gradle as the official build tool for Android
 Instead of XML, Gradle has its own DSL based on Groovy
 Apache Groovy is a powerful, optionally typed and dynamic language,
with static-typing and static compilation capabilities, for the Java
platform aimed at improving developer productivity.
 DSL: Domain-Specific Language.
 GPL: General-Purpose Language such as Java, C/CPP, and XML.
 Maven could have one advantage over Gradle which
is wide integration range with almost all IDE
14
Gradle – A New Sheriff In Town
15
Continuous Integration
 CI is a software development practice where members of a team
integrate their work frequently, usually each person integrates at
least daily – leading to multiple integrations per day. Each
integration is verified by an automated build (including test) to
detect integration errors as quickly as possible.
 This concept was meant to remove the problem of finding the late
occurrences of issues in the build lifecycle.
 Instead of the developers working in isolation and not integrating
enough, continuous integration was introduced to ensure that the
code changes and builds were never done in isolation.
16
17
Why Continuous Integration
The continuous Integration process helps to answer the following questions
for the software development team:
 Do all the software components work together as they should?
 It’s always critical to ensure that all the software components work seamlessly
with each other.
 Is the code too complex for integration purposes?
 If CI keeps on failing, there could be a possibility that the code is just too
complex. And this could be a signal to apply proper design patterns to make
the code lesser complex and more maintainable.
 Does the code adhere to the established coding standards?
 By doing an automated test after the automated build, this is a good point to
check if the code meets all the desired coding standards.
18
Why Continuous Integration
 How much code is covered by automated tests?
 There is no point in testing code if the test cases don’t cover the
required functionality of the code.
 So it’s always a good practice to ensure that the test cases written
should cover all the key scenarios of the application.
 Were all the tests successful after the latest change?
 If a test fails, then there is no point in proceeding with the
deployment of the code, so this is a good point to check if the code
is ready to move to the deployment stage or not
19
Workflow
1. A developer commits the code to the version control repository. Meanwhile, the CI
server on the integration build machine polls source code repository for changes.
2. After a commit occurs, the CI server detects that changes have occurred in the version
control repository, so the Continuous Integration server retrieves the latest copy of the
code from the repository and then executes a build script, which integrates the
software.
3. The Continuous Integration server generates feedback by
e-mailing build results to the specified project members.
4. Unit tests are then carried out if the build of that project passes. If the tests are
successful, the code is ready to be deployed to either the staging or production server.
5. The Continuous Integration server continues to poll for changes in the version control
repository and the whole process repeats.
20
21
Benefits
 Integration bugs are detected early and are easy to track down due to small
change sets.
 This saves both time and money over the lifespan of a project.
 Avoids last-minute chaos at release dates, when everyone tries to check in
their slightly incompatible versions.
 Constant availability of a "current" build for testing, demo, or release
purposes.
 When unit tests fail or a bug emerges, if developers need to revert the code-
base to a bug-free state without debugging, only a small number of changes
are lost.
 Because integration happens frequently.
 Increase visibility which enables greater communication
22
Benefits
 Spend less time debugging and more time adding features
 Proceed in the confidence you’re building on a solid foundation
 Reduce integration problems allowing you to deliver software more
rapidly
 Automate the build
 Make your build self-testing
 Automate deployment
 Continuous Integration is quality assurance
 Frequent code check-in pushes developers to create modular, less complex
code
23
What’s Jenkins
 Jenkins is a self-contained, open source automation server which
can be used to automate all sorts of tasks related to building,
testing, and delivering or deploying software.
 Jenkins can be installed through native system packages,
Docker, or even run standalone by any machine with a Java
Runtime Environment (JRE) installed.
 https://youtu.be/p7-U1_E_j3w
24
What’s Jenkins
 Jenkins offers a simple way to set up a continuous integration or
continuous delivery environment for almost any combination of
languages and source code repositories using pipelines, as well
as automating other routine development tasks. While Jenkins
doesn’t eliminate the need to create scripts for individual steps,
it does give you a faster and more robust way to integrate your
entire chain of build, test, and deployment tools than you can
easily build yourself.
25
Jenkins and Hudson
 Jenkins is a fork of Hudson, Hudson was original project which
was open source and supported by Sun. When Oracle bought
Sun, it took control over Hudson name and logistic platform of
Hudson, and provided Jenkins as the new platform.
 Essentially difference is that Maven is project management while
Jenkins or Hudson is a Continues Integration Frameworks.
 By using CI tools like Hudson or Jenkins you can trigger hourly or
daily builds automatically.
 Jenkins or Hudson can use Maven as build tool.
26
27
Revisiting Maven
28
Build Life Cycles, Phases and Goals
 The build process in Maven is split up into build life cycles,
phases and goals.
 A build life cycle consists of a sequence of build phases, and each
build phase consists of a sequence of goals.
 A goal represents a specific task which contributes to the
building and managing of a project.
 When you run Maven you pass a command to Maven. This
command is the name of a build life cycle, phase or goal.
 If a life cycle is requested to be executed, all build phases in that
life cycle are executed.
29
Build Life Cycles, Phases and Goals
 There are three built-in build lifecycles: default, clean and site.
 Default lifecycle handles project deployment.
 Clean lifecycle handles project cleaning.
 Site lifecycle handles the creation of project's site documentation.
 The default lifecycle comprises of the following phases:
 Compile - compile the source code of the project
 Test - test the compiled source code using a suitable unit testing framework
 Package - take the compiled code and package it in its distributable format (i.e Java
ARchives – JARs)
 Install - install the package into the local repository, for use as a dependency in other
projects locally
 Deploy - done in the build environment, copies the final package to the remote repository
for sharing with other developers and projects
30
Plug-ins
 Maven follows a plug-in–based architecture, making it easy to
augment and customize its functionality.
 Build plugins are used to insert extra goals into a build phase.
If you need to perform a set of actions for your project which
are not covered by the standard Maven build phases and
goals, you can add a plugin to the POM file.
 Maven has some standard plugins you can use, and you can
also implement your own in Java if you need to. Thereby
enabling you to integrate tasks and workflows that are
specific to your organization.
31
Plug-ins
 These plug-ins encapsulate reusable build and task logic. Today,
there are hundreds of Maven plug-ins available that can be used to
carry out tasks ranging from code compilation to packaging to
project documentation generation.
 Types of plugins:
 Core plugins: plugins corresponding to default phases (i.e clean, and
compile)
 Packaging types/tools: plugins relate to packaging respective artifact
types
 Reporting plugins: plugins which generate reports
 Tools plugins: These are miscellaneous tools available through maven by
default
32
Graphical Illustration
33
What’s The POM File
 POM is an acronym for Project Object
Model.
 A POM file is an XML representation
of project resources like source code,
test code, dependencies (external
JARs used) etc.
 The POM contains references to all of
these resources.
 Build settings also can be defined in
the POM file i.e which version of java
to use, or the final build name of
artifact generated etc.
 The POM file should be located in the
root directory of the project it
belongs to. 34
POM File Example
<project>
<modelVersion>4.0.0</modelVersion> <!--always 4.0.0 for Maven 2.x POMs-->
<--a group of values which uniquely identify this project -->
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId> <!-- project name -->
<version>1.0</version> <!-- project version -->
<dependencies> <!-- library dependencies -->
<dependency> <!-- this project will use junit for testing -->
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope> <!-- Scope of this Dependency is testing only -->
</dependency> <!-- closing junit dependency tag -->
</dependencies> <!--- closing all dependencies tag -->
</project>
35
POM File
 Minimal requirements for a POM
 Project root
 Model version
 Group id
 Artifact id
 Version
36
POM File
 The project tag: this is project root tag. You can specify the basic
schema settings such as apache schema and w3.org.
 The modelVersion tag: sets what version of the POM model you are
using. Use the one matching the Maven version you are using. Version
4.0.0 matches Maven version 2 and 3.
 The groupId tag: This is an Id of project's group. This is generally
unique amongst an organization or a project, the project will be
located in the Maven repository under a directory structure matching
the groupId.
 For example, a banking group com.company.bank has all bank related
projects.
37
POM File
 The artifactId tag: contains the name of the project you are building
 For example, consumer-banking.
 Along with the groupId, the artifactId defines the artifact's location within
the repository
 The version tag: sets the version of the project. Along with the groupId, It
is used within an artifact's repository to separate versions from each other.
 Example:
 com.company.bank:consumer-banking:1.0
 com.company.bank:consumer-banking:1.1
38
Super POM File
 The Super POM is Maven’s default POM. All POMs inherit from
a parent or default (despite explicitly defined or not). This
base POM is known as the Super POM, and contains values
inherited by default.
 An easy way to look at the default configurations of the super
POM is by running the following command:
 mvn help:effective-pom.
39
Further Readings
 Books:
 Maven Essential, by Prabath Siriwardena
 Introducing Maven, by Sudha Belida and Balaji Varanasi
 Continuous Delivery with Docker and Jenkins, by Rafał Leszko
 Continuous Integration: Improving Software Quality and Reducing Risk, by Andrew Glover, Paul M. Duvall,
and Steve Matyas
 Online Tutorials:
 https://maven.apache.org/index.html
 http://javarevisited.blogspot.com.eg/2015/01/difference-between-maven-ant-jenkins-and-hudson.html
 http://tutorials.jenkov.com/maven/maven-tutorial.html
 https://www.tutorialspoint.com/maven/index.htm
 https://www.tutorialspoint.com/jenkins/index.htm
 https://www.tutorialspoint.com/continuous_integration/index.htm
 https://www.youtube.com/playlist?list=PLhW3qG5bs-L_ZCOA4zNPSoGbnVQ-rp_dG
40
41
42
43
44

More Related Content

PDF
SE2018_Lec 18_ Design Principles and Design Patterns
Amr E. Mohamed
 
PDF
SE2018_Lec 21_ Software Configuration Management (SCM)
Amr E. Mohamed
 
DOCX
Software engineering Questions and Answers
Bala Ganesh
 
PDF
SE18_SE_Lec 12_ Project Management 1
Amr E. Mohamed
 
PDF
SE18_Lec 05_Agile Software Development
Amr E. Mohamed
 
PDF
Software engineering note
Neelamani Samal
 
PDF
SE18_Lec 00_Course Outline
Amr E. Mohamed
 
PDF
SE2_Lec 19_Design Principles and Design Patterns
Amr E. Mohamed
 
SE2018_Lec 18_ Design Principles and Design Patterns
Amr E. Mohamed
 
SE2018_Lec 21_ Software Configuration Management (SCM)
Amr E. Mohamed
 
Software engineering Questions and Answers
Bala Ganesh
 
SE18_SE_Lec 12_ Project Management 1
Amr E. Mohamed
 
SE18_Lec 05_Agile Software Development
Amr E. Mohamed
 
Software engineering note
Neelamani Samal
 
SE18_Lec 00_Course Outline
Amr E. Mohamed
 
SE2_Lec 19_Design Principles and Design Patterns
Amr E. Mohamed
 

What's hot (19)

DOCX
Software Engineering Assignment
Sohaib Latif
 
PPT
software engineering
ramyavarkala
 
DOCX
Swe notes
Mohammed Romi
 
PPTX
Software engineering principles in system software design
Tech_MX
 
PPTX
Software process
Jennifer Polack
 
PPT
962 sech04
aldwal
 
PDF
Software engineering lecture notes
Ammar Shafiq
 
PPT
software Engineering process
Raheel Aslam
 
PPT
Introduction to Software Development
Zeeshan MIrza
 
DOCX
Software Engineering Solved Past Paper 2020
MuhammadTalha436
 
PDF
SWE-401 - 3. Software Project Management
ghayour abbas
 
PPTX
SE Unit 1
UmaMaheswariBHCInfor
 
PDF
Engineering Software Products: 2. agile software engineering
software-engineering-book
 
PPTX
Ch8-Software Engineering 9
Ian Sommerville
 
PDF
Software engineering mca
Aman Adhikari
 
PPTX
Software Engineering
JayaKamal
 
PPT
Unit1
anuragmbst
 
PDF
Cs504 handouts 1_45
Ahsan Younis
 
PPTX
Software Engineering- Crisis and Process Models
Nishu Rastogi
 
Software Engineering Assignment
Sohaib Latif
 
software engineering
ramyavarkala
 
Swe notes
Mohammed Romi
 
Software engineering principles in system software design
Tech_MX
 
Software process
Jennifer Polack
 
962 sech04
aldwal
 
Software engineering lecture notes
Ammar Shafiq
 
software Engineering process
Raheel Aslam
 
Introduction to Software Development
Zeeshan MIrza
 
Software Engineering Solved Past Paper 2020
MuhammadTalha436
 
SWE-401 - 3. Software Project Management
ghayour abbas
 
Engineering Software Products: 2. agile software engineering
software-engineering-book
 
Ch8-Software Engineering 9
Ian Sommerville
 
Software engineering mca
Aman Adhikari
 
Software Engineering
JayaKamal
 
Unit1
anuragmbst
 
Cs504 handouts 1_45
Ahsan Younis
 
Software Engineering- Crisis and Process Models
Nishu Rastogi
 
Ad

Similar to SE2018_Lec-22_-Continuous-Integration-Tools (20)

PPT
software technology benchmarking
Mallikarjuna G D
 
PPT
Build tool
Mallikarjuna G D
 
PPT
Presentation 1 open source tools in continuous integration environment v1.0
Jasmine Conseil
 
PPTX
Ci jenkins maven svn
Ankur Goyal
 
PDF
Mavennotes.pdf
AnkurSingh656748
 
PDF
TMF2014 CI-CD Workshop Michael Palotas
KJR
 
PDF
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
PPTX
Maven basics
Vijay Krishnan Ramaswamy
 
PDF
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Michael Palotas
 
PPTX
Maven ppt
natashasweety7
 
PPT
Java Build Tools
­Avishek A
 
PPTX
An Introduction to Maven
Vadym Lotar
 
PDF
Maven definitive guide
virusworm
 
PPT
Maven
darshanvartak
 
PPT
Introduction tomaven
Manav Prasad
 
PPTX
CQ5 Development Setup, Maven Build and Deployment
6D Global
 
PPTX
CQ5 Development Setup, Maven Build and Deployment
klcodanr
 
PPTX
Build Tools & Maven
David Simons
 
software technology benchmarking
Mallikarjuna G D
 
Build tool
Mallikarjuna G D
 
Presentation 1 open source tools in continuous integration environment v1.0
Jasmine Conseil
 
Ci jenkins maven svn
Ankur Goyal
 
Mavennotes.pdf
AnkurSingh656748
 
TMF2014 CI-CD Workshop Michael Palotas
KJR
 
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
Agile Bodensee - Testautomation & Continuous Delivery Workshop
Michael Palotas
 
Maven ppt
natashasweety7
 
Java Build Tools
­Avishek A
 
An Introduction to Maven
Vadym Lotar
 
Maven definitive guide
virusworm
 
Introduction tomaven
Manav Prasad
 
CQ5 Development Setup, Maven Build and Deployment
6D Global
 
CQ5 Development Setup, Maven Build and Deployment
klcodanr
 
Build Tools & Maven
David Simons
 
Ad

More from Amr E. Mohamed (20)

PDF
Dsp 2018 foehu - lec 10 - multi-rate digital signal processing
Amr E. Mohamed
 
PDF
Dcs lec03 - z-analysis of discrete time control systems
Amr E. Mohamed
 
PDF
Dcs lec02 - z-transform
Amr E. Mohamed
 
PDF
Dcs lec01 - introduction to discrete-time control systems
Amr E. Mohamed
 
PDF
DDSP_2018_FOEHU - Lec 10 - Digital Signal Processing Applications
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
Amr E. Mohamed
 
PDF
SE2018_Lec 17_ Coding
Amr E. Mohamed
 
PDF
Selenium - Introduction
Amr E. Mohamed
 
PPTX
SE2018_Lec 20_ Test-Driven Development (TDD)
Amr E. Mohamed
 
PDF
SE2018_Lec 19_ Software Testing
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 05 - Digital Filters
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 04 - The z-Transform
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 03 - Discrete-Time Signals and Systems
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
Amr E. Mohamed
 
PDF
SE2018_Lec 15_ Software Design
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 1 - Introduction to Digital Signal Processing
Amr E. Mohamed
 
PDF
DSP_2018_FOEHU - Lec 0 - Course Outlines
Amr E. Mohamed
 
PDF
SE2018_Lec 14_ Process Modeling and Data Flow Diagram.pptx
Amr E. Mohamed
 
Dsp 2018 foehu - lec 10 - multi-rate digital signal processing
Amr E. Mohamed
 
Dcs lec03 - z-analysis of discrete time control systems
Amr E. Mohamed
 
Dcs lec02 - z-transform
Amr E. Mohamed
 
Dcs lec01 - introduction to discrete-time control systems
Amr E. Mohamed
 
DDSP_2018_FOEHU - Lec 10 - Digital Signal Processing Applications
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
Amr E. Mohamed
 
SE2018_Lec 17_ Coding
Amr E. Mohamed
 
Selenium - Introduction
Amr E. Mohamed
 
SE2018_Lec 20_ Test-Driven Development (TDD)
Amr E. Mohamed
 
SE2018_Lec 19_ Software Testing
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 05 - Digital Filters
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 04 - The z-Transform
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 03 - Discrete-Time Signals and Systems
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
Amr E. Mohamed
 
SE2018_Lec 15_ Software Design
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 1 - Introduction to Digital Signal Processing
Amr E. Mohamed
 
DSP_2018_FOEHU - Lec 0 - Course Outlines
Amr E. Mohamed
 
SE2018_Lec 14_ Process Modeling and Data Flow Diagram.pptx
Amr E. Mohamed
 

Recently uploaded (20)

PDF
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PDF
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PPTX
quantum computing transition from classical mechanics.pptx
gvlbcy
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PDF
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PDF
Construction of a Thermal Vacuum Chamber for Environment Test of Triple CubeS...
2208441
 
PDF
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
PPTX
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
PPTX
Tunnel Ventilation System in Kanpur Metro
220105053
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPT
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
Introduction to Ship Engine Room Systems.pdf
Mahmoud Moghtaderi
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
settlement FOR FOUNDATION ENGINEERS.pdf
Endalkazene
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
quantum computing transition from classical mechanics.pptx
gvlbcy
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Machine Learning All topics Covers In This Single Slides
AmritTiwari19
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Construction of a Thermal Vacuum Chamber for Environment Test of Triple CubeS...
2208441
 
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
MULTI LEVEL DATA TRACKING USING COOJA.pptx
dollysharma12ab
 
Tunnel Ventilation System in Kanpur Metro
220105053
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Understanding the Key Components and Parts of a Drone System.ppt
Siva Reddy
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 

SE2018_Lec-22_-Continuous-Integration-Tools

  • 1. By: - Abdullah Ibrahim Salama - Muhammad Abdul-Fattah Abulmajd
  • 2. Agenda  What’s a Build Tool  Advantages of Build Automation  What’s Maven  Objectives  Features  Helps To Manage  Why Maven Not Ant  Gradle – A New Sheriff In Town  Continuous Integration  Why Continuous Integration  Workflow  Benefits  What’s Jenkins  Jenkins and Hudson  Build Life Cycles, Phases, and Goals  Plug-ins  POM File  What’s POM File  POM File Example  POM File Minimal Requirements  Super POM File  Further Readings 2
  • 3. What’s a Build Tool  Generating source code (if auto-generated code is used in the project).  Generating documentation from the source code.  Compiling source code.  Packaging compiled code into JAR files or ZIP files.  Installing the packaged code on a server, in a repository or somewhere else. 3
  • 4. Advantages of Build Automation  A necessary pre-condition for continuous integration (CI) and continuous testing.  Improve product quality.  Accelerate the compile and link processing.  Eliminate redundant tasks.  Minimize "bad builds".  Eliminate dependencies on key personnel.  Minimize the risk of humans making errors while building the software manually.  Have history of builds and releases in order to investigate issues.  Save time and money - because of the reasons listed above. 4
  • 5. What’s Maven  Maven is a powerful project management tool that is based on POM (Project Object Model). It is used for projects build, dependency and documentation.  Maven was released in 2004. Its goal was to improve upon some of the problems developers were facing when using Ant.  Maven simplifies and standardizes the project build process.  Maven increases reusability and takes care of most of the build related tasks. 5
  • 6. Objectives  Maven’s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal there are several areas of concern that Maven attempts to deal with:  Making the build process easy  While using Maven doesn’t eliminate the need to know about the underlying mechanisms, Maven does provide a lot of shielding from the details.  Providing a uniform build system  Maven allows a project to build using its project object model (POM) and a set of plugins that are shared by all projects using Maven, providing a uniform build system. 6
  • 7. Objectives  Providing quality project information and reporting  Maven provides plenty of useful project information that is in part taken from your POM and in part generated from your project’s sources. For example, Maven can provide:  log document,  cross referenced sources,  dependency list,  unit test reports, and etc.  Easy to migrate for new features of Maven 7
  • 8. Objectives  Providing guidelines for best practices development  Maven aims to gather current principles for best practices development, and make it easy to guide a project in that direction.  For example, specification, execution, and reporting of unit tests are part of the normal build cycle using Maven. Current unit testing best practices were used as guidelines:  Keeping your test source code in a separate, but parallel source tree  Using test case naming conventions to locate and execute tests  Have test cases setup their environment and don’t rely on customizing the build for test preparation.  Maven also aims to assist in project workflow such as release management and issue tracking.  Maven also suggests some guidelines on how to layout your project’s directory structure so that once you learn the layout you can easily navigate any other project that uses Maven and the same defaults. 8
  • 9. Features  Simple project setup that follows best practices.  Consistent usage across all projects.  Dependency management including automatic updating.  A large and growing repository of libraries.  Extensible, with the ability to easily write plugins in Java or scripting languages.  Instant access to new features with little or no extra configuration.  Backward Compatibility  Model-based builds − Maven is able to build any number of projects into predefined output types such as jar, war, metadata.  Coherent site of project information  Using the same metadata as per the build process, maven is able to generate a website and a PDF including complete documentation.  Release management and distribution publication  Better Error and Integrity Reporting 9
  • 10. Helps To Manage  Builds  Documentation  Reporting  Dependencies  Including automatic updating  SCMs  Releases  Distribution 10
  • 11. Why Maven Not Ant  Main difference is that in ANT you need to define every thing i.e source dir, build dir, target and etc. While Maven adopts principle of Convention over Configuration.  CoC results in  Little/no configuration  Following pre-scripted conventions  Reasonable defaults  Override when required  Which means Maven has predefined project structure i.e standard directory for source files, test files and resources etc. 11
  • 12. Why Maven Not Ant  Maven introduced concept of repository, which is a central place to store all libraries, JARs etc. Maven allows you to use central maven repository (remote) as well as local repository and automatically download dependency during build process.  The local repository is a folder inside the machine in which a project is being developed, acting as a cache with respect to the remote repositories.  Apache provides a central repository containing thousands of common dependencies, which is the default one.  Maven does not rely on this specific repository, thus allowing users to define their own custom repositories.  While ANT based project generally use ${lib} as directory to store dependencies. Manual dependency management.  Changing and updating dependency is much easier in maven than ANT because you don't need to manually download dependency. Having an organization wide central repository also helps to remove redundancy across different projects. 12
  • 13. Why Maven Not Ant  Maven provides a uniform interface for building projects. You can build a Maven project by using just a handful of commands. All you need to do is download the project and run mvn install to build it.  Also by knowing maven conventions and looking at pom.xml, one can easily understand where source files are and what are project dependencies.  ANT doesn't have any lifecycle, you need to define targets and there dependencies. While Maven has lifecycle, which is invoked when you run commands like mvn install. Maven executes a series of steps as a result of this command to produce artifacts e.g. JAR file, which is end of life cycle  Inheritance: This concept simply means that everything that is not specified in a POM file is inherited from the upper-level POM.  At the top level, Maven provides a parent POM defining all default values. 13
  • 14. Gradle – A New Sheriff In Town  An open-source, build automation system, released in 2012, that builds upon the concepts of Ant and Maven  Has all advantages of Maven plus Ant flexibility.  Google chose Gradle as the official build tool for Android  Instead of XML, Gradle has its own DSL based on Groovy  Apache Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities, for the Java platform aimed at improving developer productivity.  DSL: Domain-Specific Language.  GPL: General-Purpose Language such as Java, C/CPP, and XML.  Maven could have one advantage over Gradle which is wide integration range with almost all IDE 14
  • 15. Gradle – A New Sheriff In Town 15
  • 16. Continuous Integration  CI is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily – leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.  This concept was meant to remove the problem of finding the late occurrences of issues in the build lifecycle.  Instead of the developers working in isolation and not integrating enough, continuous integration was introduced to ensure that the code changes and builds were never done in isolation. 16
  • 17. 17
  • 18. Why Continuous Integration The continuous Integration process helps to answer the following questions for the software development team:  Do all the software components work together as they should?  It’s always critical to ensure that all the software components work seamlessly with each other.  Is the code too complex for integration purposes?  If CI keeps on failing, there could be a possibility that the code is just too complex. And this could be a signal to apply proper design patterns to make the code lesser complex and more maintainable.  Does the code adhere to the established coding standards?  By doing an automated test after the automated build, this is a good point to check if the code meets all the desired coding standards. 18
  • 19. Why Continuous Integration  How much code is covered by automated tests?  There is no point in testing code if the test cases don’t cover the required functionality of the code.  So it’s always a good practice to ensure that the test cases written should cover all the key scenarios of the application.  Were all the tests successful after the latest change?  If a test fails, then there is no point in proceeding with the deployment of the code, so this is a good point to check if the code is ready to move to the deployment stage or not 19
  • 20. Workflow 1. A developer commits the code to the version control repository. Meanwhile, the CI server on the integration build machine polls source code repository for changes. 2. After a commit occurs, the CI server detects that changes have occurred in the version control repository, so the Continuous Integration server retrieves the latest copy of the code from the repository and then executes a build script, which integrates the software. 3. The Continuous Integration server generates feedback by e-mailing build results to the specified project members. 4. Unit tests are then carried out if the build of that project passes. If the tests are successful, the code is ready to be deployed to either the staging or production server. 5. The Continuous Integration server continues to poll for changes in the version control repository and the whole process repeats. 20
  • 21. 21
  • 22. Benefits  Integration bugs are detected early and are easy to track down due to small change sets.  This saves both time and money over the lifespan of a project.  Avoids last-minute chaos at release dates, when everyone tries to check in their slightly incompatible versions.  Constant availability of a "current" build for testing, demo, or release purposes.  When unit tests fail or a bug emerges, if developers need to revert the code- base to a bug-free state without debugging, only a small number of changes are lost.  Because integration happens frequently.  Increase visibility which enables greater communication 22
  • 23. Benefits  Spend less time debugging and more time adding features  Proceed in the confidence you’re building on a solid foundation  Reduce integration problems allowing you to deliver software more rapidly  Automate the build  Make your build self-testing  Automate deployment  Continuous Integration is quality assurance  Frequent code check-in pushes developers to create modular, less complex code 23
  • 24. What’s Jenkins  Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.  Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.  https://youtu.be/p7-U1_E_j3w 24
  • 25. What’s Jenkins  Jenkins offers a simple way to set up a continuous integration or continuous delivery environment for almost any combination of languages and source code repositories using pipelines, as well as automating other routine development tasks. While Jenkins doesn’t eliminate the need to create scripts for individual steps, it does give you a faster and more robust way to integrate your entire chain of build, test, and deployment tools than you can easily build yourself. 25
  • 26. Jenkins and Hudson  Jenkins is a fork of Hudson, Hudson was original project which was open source and supported by Sun. When Oracle bought Sun, it took control over Hudson name and logistic platform of Hudson, and provided Jenkins as the new platform.  Essentially difference is that Maven is project management while Jenkins or Hudson is a Continues Integration Frameworks.  By using CI tools like Hudson or Jenkins you can trigger hourly or daily builds automatically.  Jenkins or Hudson can use Maven as build tool. 26
  • 27. 27
  • 29. Build Life Cycles, Phases and Goals  The build process in Maven is split up into build life cycles, phases and goals.  A build life cycle consists of a sequence of build phases, and each build phase consists of a sequence of goals.  A goal represents a specific task which contributes to the building and managing of a project.  When you run Maven you pass a command to Maven. This command is the name of a build life cycle, phase or goal.  If a life cycle is requested to be executed, all build phases in that life cycle are executed. 29
  • 30. Build Life Cycles, Phases and Goals  There are three built-in build lifecycles: default, clean and site.  Default lifecycle handles project deployment.  Clean lifecycle handles project cleaning.  Site lifecycle handles the creation of project's site documentation.  The default lifecycle comprises of the following phases:  Compile - compile the source code of the project  Test - test the compiled source code using a suitable unit testing framework  Package - take the compiled code and package it in its distributable format (i.e Java ARchives – JARs)  Install - install the package into the local repository, for use as a dependency in other projects locally  Deploy - done in the build environment, copies the final package to the remote repository for sharing with other developers and projects 30
  • 31. Plug-ins  Maven follows a plug-in–based architecture, making it easy to augment and customize its functionality.  Build plugins are used to insert extra goals into a build phase. If you need to perform a set of actions for your project which are not covered by the standard Maven build phases and goals, you can add a plugin to the POM file.  Maven has some standard plugins you can use, and you can also implement your own in Java if you need to. Thereby enabling you to integrate tasks and workflows that are specific to your organization. 31
  • 32. Plug-ins  These plug-ins encapsulate reusable build and task logic. Today, there are hundreds of Maven plug-ins available that can be used to carry out tasks ranging from code compilation to packaging to project documentation generation.  Types of plugins:  Core plugins: plugins corresponding to default phases (i.e clean, and compile)  Packaging types/tools: plugins relate to packaging respective artifact types  Reporting plugins: plugins which generate reports  Tools plugins: These are miscellaneous tools available through maven by default 32
  • 34. What’s The POM File  POM is an acronym for Project Object Model.  A POM file is an XML representation of project resources like source code, test code, dependencies (external JARs used) etc.  The POM contains references to all of these resources.  Build settings also can be defined in the POM file i.e which version of java to use, or the final build name of artifact generated etc.  The POM file should be located in the root directory of the project it belongs to. 34
  • 35. POM File Example <project> <modelVersion>4.0.0</modelVersion> <!--always 4.0.0 for Maven 2.x POMs--> <--a group of values which uniquely identify this project --> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <!-- project name --> <version>1.0</version> <!-- project version --> <dependencies> <!-- library dependencies --> <dependency> <!-- this project will use junit for testing --> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> <!-- Scope of this Dependency is testing only --> </dependency> <!-- closing junit dependency tag --> </dependencies> <!--- closing all dependencies tag --> </project> 35
  • 36. POM File  Minimal requirements for a POM  Project root  Model version  Group id  Artifact id  Version 36
  • 37. POM File  The project tag: this is project root tag. You can specify the basic schema settings such as apache schema and w3.org.  The modelVersion tag: sets what version of the POM model you are using. Use the one matching the Maven version you are using. Version 4.0.0 matches Maven version 2 and 3.  The groupId tag: This is an Id of project's group. This is generally unique amongst an organization or a project, the project will be located in the Maven repository under a directory structure matching the groupId.  For example, a banking group com.company.bank has all bank related projects. 37
  • 38. POM File  The artifactId tag: contains the name of the project you are building  For example, consumer-banking.  Along with the groupId, the artifactId defines the artifact's location within the repository  The version tag: sets the version of the project. Along with the groupId, It is used within an artifact's repository to separate versions from each other.  Example:  com.company.bank:consumer-banking:1.0  com.company.bank:consumer-banking:1.1 38
  • 39. Super POM File  The Super POM is Maven’s default POM. All POMs inherit from a parent or default (despite explicitly defined or not). This base POM is known as the Super POM, and contains values inherited by default.  An easy way to look at the default configurations of the super POM is by running the following command:  mvn help:effective-pom. 39
  • 40. Further Readings  Books:  Maven Essential, by Prabath Siriwardena  Introducing Maven, by Sudha Belida and Balaji Varanasi  Continuous Delivery with Docker and Jenkins, by Rafał Leszko  Continuous Integration: Improving Software Quality and Reducing Risk, by Andrew Glover, Paul M. Duvall, and Steve Matyas  Online Tutorials:  https://maven.apache.org/index.html  http://javarevisited.blogspot.com.eg/2015/01/difference-between-maven-ant-jenkins-and-hudson.html  http://tutorials.jenkov.com/maven/maven-tutorial.html  https://www.tutorialspoint.com/maven/index.htm  https://www.tutorialspoint.com/jenkins/index.htm  https://www.tutorialspoint.com/continuous_integration/index.htm  https://www.youtube.com/playlist?list=PLhW3qG5bs-L_ZCOA4zNPSoGbnVQ-rp_dG 40
  • 41. 41
  • 42. 42
  • 43. 43
  • 44. 44