SlideShare a Scribd company logo
Slide 1 of 55© People Strategists www.peoplestrategists.com
Exploring Maven,
SVN and GIT
Slide 2 of 55© People Strategists www.peoplestrategists.com
Objectives
In this session, you will learn to:
Explore Maven
Install and set up Maven
Create and build Web application using Maven
Manage Dependency
Introduce version control system
Explore subversion
Create repository in subversion
Merge code and avoid conflict
Explore GIT
Explore GitEye
Slide 3 of 55© People Strategists www.peoplestrategists.com
Exploring Maven
Maven:
Is a Yiddish word that means "accumulator of knowledge".
Is a tool that can be used for building and managing any Java based
project.
Is based on the concept of a Project Object Model (POM), which is an xml
file.
Helps Java Developers to understand the structure of a Java-based project
by providing a proper directory structure.
Provides collection of jar files known as Maven repositories.
Provides set of commands to download and make use of Maven
repositories.
Maven commands can be used from the Windows command prompt.
Slide 4 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Maven repositories are used to store constructed artifacts and
dependencies of several types.
The two types of Maven repositories are:
Remote repositories:
 Mean repositories accessed by different protocols, such as file:// and http://.
 Might be central repositories, which are developed by Maven community, or by
a third party to provide their artifacts for downloading.
 For example, the repo.maven.apache.org is a central repository and
http://maven.objectify-appengine.googlecode.com/git/ is a third party
repository.
Local repositories:
 Refer to a copy of remote downloads on your computer.
 Are cache of the remote downloads and contains the temporary build artifacts
that you have not yet released.
Maven archetypes (readymade templates) allow users to create
projects using templates, which are based on common scenarios.
Slide 5 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Maven project structure of core application:
Project
Home
Project Structure of Core Application
Slide 6 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Maven project structure of Web application:
Project
Home
Project Structure of Web Application
Slide 7 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Following table lists the description of the project structure.
Folder Description
project home Contains the pom.xml and all subdirectories.
src/main/java Contains the Java classes for the project.
src/main/resources
Contains the deliverable resources for the project, such as
property files.
src/main/webapp Contains the html or jsp files.
src/main/webapp/WEB-
INF Contains all the configuration files, such as web.xml.
src/main/webapp/css Contains all the stylesheet files of the Web application.
src/test/java
Contains the testing classes (JUnit or TestNG test cases) for
the project.
src/test/resources Contains resources necessary for testing.
Slide 8 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Project Object Model (POM):
It was named project.xml in earlier version of Maven.
It is the fundamental unit of work in Maven.
It is an XML file that contains information about the project.
It always resides in the base directory of the project as pom.xml.
It also contains the configuration details, such as plugin, goals, build
profiles and various dependencies used by Maven to build the project.
Slide 9 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Some important terms used in pom.xml are:
project: It is the root element for the pom.xml file.
modelVersion: It indicates the version of the project object model.
groupId: It identifies your project uniquely across all projects. If a user uses
your project, it serves as an attribute of the dependency in pom.xml.
artifactId: It is the name of your project within Maven and specifies the
artifact's location within the repository.
version: It refers to the initial maven version of your project. It is used
within an artifact's repository to maintain different copy of an application.
If you want that your artifact should be using last deployed version, you
can suffix the version with –SNAPSHOT.
package: It refers to the Java package that is created while creating a
project.
Slide 10 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
SNAPSHOT: It is a special version that indicates a current development
copy of your artifact. Unlike regular versions, Maven checks for a new
SNAPSHOT version in a remote repository and fetches the last deployed
version for every build.
plugin: It defines the plugin you project is using.
dependency: It defines the version of the project object model.
Maven uses the pom.xml file in the following order:
Read the pom.xml file and parse the content.
Download dependencies to local dependency repository.
Execute life cycle/build phase/goal.
Execute plugins, if any.
Slide 11 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Two types of the POM are:
Minimal POM
Super POM
Slide 12 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Minimal POM:
It contains only the necessary elements, which are:
 project
 modelVersion
 groupId
 artifactId
 version
The following code illustrates the minimal POM:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
</project>
Slide 13 of 55© People Strategists www.peoplestrategists.com
Exploring Maven (Contd.)
Super POM:
It is Maven's default POM and can comprise of all the elements.
The following code illustrates super POM:
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1</version>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
</plugins>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${mavenVersion}</version>
</dependency>
</project>
Slide 14 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven
The following table lists the system requirements for installing
Maven.
Item Requirements
JDK Maven 3.2 requires JDK 1.6 or above
Maven 3.0/3.1 requires JDK 1.5 or above
Memory No minimum requirement
Disk 10MB for the Maven installation itself.
At least 500MB for your local Maven repository.
Operating System No minimum requirement.
Slide 15 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To install and set up Maven, You need to perform following steps:
Set up JDK
Install Maven
Set Maven environment variables
Configure system path
Slide 16 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To set up JDK in windows, you need to perform following steps:
Download the latest SDK from the URL,
http://www.oracle.com/technetwork/java/javase/downloads/in
dex.html.
Set the JAVA_HOME path to C:Program FilesJavajdk1.8.0 path.
Set the PATH variable to C:Jdk_Folderbin;%PATH%;.
To set up JDK in linux, you need to perform following steps:
Download the latest SDK from the URL,
http://www.oracle.com/technetwork/java/javase/downloads/in
dex.html.
Type export JAVA_HOME=/usr/local/jdk on command prompt.
Type export PATH=$PATH:$JAVA_HOME/bin/ on command prompt.
Set up JDK
Slide 17 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To install Maven in windows, You need to perform following steps:
Go to the URL, http://maven.apache.org/download.cgi to
download installation file for your target system.
Extract the file to a directory. For example, C:apache-maven.
In linux, extract the file to the following directory:
/usr/local/apache-maven
Install Maven
Slide 18 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
To set these in windows, you need to perform following steps:
Set M2_HOME to C:apache-maven-install-path.
Set M2 to %M2_HOME%bin.
Set MAVEN_OPTS to -Xms256m -Xmx512m.
To set these in linux, you need to perform following steps:
Type export M2_HOME=/usr/local/apache-maven-install-path
on command prompt.
Type export M2=$M2_HOME/bin on command prompt.
Type export MAVEN_OPTS=-Xms256m -Xmx512m on command prompt.
Set Maven environment variables
Slide 19 of 55© People Strategists www.peoplestrategists.com
Installing and Setting Up Maven (Contd.)
In order to use Maven command line tools anywhere on a system, we
have to add Maven bin directory location to system path.
To do this in windows, you need to perform following step:
Append the string ;%M2% to the end of the system variable PATH.
To do this in linux, you need to perform following step:
Type export PATH=$M2:$PATH on command prompt.
Configure system path
Slide 20 of 55© People Strategists www.peoplestrategists.com
Creating and Building Web Application Using Maven
Consider a scenario where you need to develop a Web application,
helloworld that displays a message “Welcome to Maven World.” For
this, you want to use the maven archetype.
The expected output of the Web application is shown in the following
figure.
The Expected Output
Slide 21 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System
Version Control System (VCS) is a software that helps software
developers to work together and maintain a complete history of their
work.
The Goals of VCS are:
It allows developers to work simultaneously.
It does not overwrite each other’s changes.
It maintains history of every version of everything.
Two categories of VCS are:
Centralized Version Control System (CVCS)
Distributed/Decentralized Version Control System (DVCS)
Slide 22 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System (Contd.)
Centralized Version Control System (CVCS):
Uses a central server to store all files and enables team collaboration.
Stores the files on a single machine called server.
Some examples are SVN and Perforce.
Distributed/Decentralized Version Control System (DVCS):
Checks out the latest snapshot of the directory and fully mirrors the
repository.
Allows any client to copy back the checked out repository to the server to
restore it.
Does not rely on the central server.
Allows you to perform operations, such as commit changes, create
branches, and view logs while you are offline.
Needs network connection only to publish your changes and take the latest
changes.
Some examples are GIT and Darcs.
Slide 23 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System (Contd.)
Some of the VCS terminologies are:
Repository:
 Is the heart of any version control system.
 Is the central place where developers store all their work.
 Stores files as well as the history.
 Is accessed over a network, acting as a server and version control tool acting as
a client.
Trunk:
 Is a directory where all the main development happens and is usually checked
out by developers to work on the project.
Branches:
 is used to create another line of development.
 Is useful to keep separate the new version of a software from the fixes of the
old version.
Slide 24 of 55© People Strategists www.peoplestrategists.com
Introducing Version Control System (Contd.)
Working copy:
 Is a snapshot of the repository.
 Is a private workplace where developers can do their work remaining isolated
from the rest of the team.
Tags:
 Use tag directory to store named snapshots of the project.
 Is a descriptive and memorable name given to a specific version in the
repository.
Commit changes:
 Is the act of committing the changes made in the working copy to the
repository.
 Is rolled back if an error comes in between the process of commit.
URL:
 Represents the location of the repository on the server.
Slide 25 of 55© People Strategists www.peoplestrategists.com
Exploring Subversion
Subversion (SVN):
Is often abbreviated as SVN and falls under CVCS.
Is developed as a project of the Apache Software Foundation.
Is a software versioning and revision control system distributed under an
open source license.
Is part of a rich community of developers and users.
Is a software that helps software developers to maintain a complete history
files.
Some of the available SVNs are:
SlikSVN (32- and 64-bit client MSI)
VisualSVN (32- and 64-bit client and server)
WANdisco (32- and 64-bit client and server)
TortoiseSVN (32-bit and 64-bit)
Slide 26 of 55© People Strategists www.peoplestrategists.com
Exploring Subversion (Contd.)
To install TortoiseSVN, follow the following steps:
Download the software from URL,
http://tortoisesvn.net/downloads.html.
Double-click the .msi file, the setup dialog box appears, as shown in the
following figure.
Follow the instructions to install the software.
The Setup Dialog Box
Slide 27 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion
Creating a repository in TortoiseSVN:
Create a new folder in your desired drive.
Right-click the folder and select TortoiseSVN -> Create repository here. The
Repository created dialog box appears as shown in the following figure.
Click the Create folder structure button.
Click the OK button.
The Repository created Dialog Box
Slide 28 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
By default, the repository has a folder layout, as shown in the following
figure.
Right-click the repository and select TortoiseSVN -> Repo-browser. It shows
the folders, as shown in the following figure.
The Folder Layout
Repository Browser
Slide 29 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
Adding a project to your repository:
Right-click the desired project.
Select TortoiseSVN -> Import. The Import dialog box appears.
Click the OK button. The project gets imported to the repository.
Click the OK button to close the Import dialog box.
Slide 30 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
Creating a working directory:
Right-click project folder.
Select SVN Checkout. The Checkout dialog box appears, as shown in the
following figure.
Click the OK button to checkout the project.
The Checkout Dialog Box
Slide 31 of 55© People Strategists www.peoplestrategists.com
Creating Repository in Subversion (Contd.)
Updating the project with latest version:
Right-click project folder in working directory.
Select SVN Update. The Update finished dialog box appears.
Click the OK button.
Committing the changes:
Right-click project folder in working directory.
Select SVN commit. The Commit dialog box appears.
Click the OK button.
Reversing the changes:
Right-click project folder in working directory.
Select TortoiseSVN -> Revert.
Select the version you want to revert in the Revert dialog box.
Click the OK button.
Slide 32 of 55© People Strategists www.peoplestrategists.com
Merging Code and Avoiding Conflict
Merging a project:
Right-click project folder.
Select TortoiseSVN -> Merge. The Merge dialog box appears, as shown in the
following figure.
Select Merge type, which are:
 Merge a range of revisions
 Merge two different trees
The Merge Dialog Box
Slide 33 of 55© People Strategists www.peoplestrategists.com
Merging Code and Avoiding Conflict (Contd.)
Merge a range of revisions merges two versions of a project from one branch to
other.
Merge two different trees merge the differences of two different branches into
your working copy.
Click Next.
Select revision range, which are:
 All revisions: It merges all the revisions.
 Specific range: It merges the specified range.
 Reverse merge: It merges the versions in reverse order.
Click the Next button.
Click the Merge button.
Slide 34 of 55© People Strategists www.peoplestrategists.com
Exploring GIT
GIT:
Was initially developed by Linus Torvalds for Linux kernel development.
Is a distributed revision control and source code management system.
Is a free software distributed under the terms of the GNU General Public License.
Is fast as most of the operations are performed locally.
Uses a common cryptographic hash function called secure hash function (SHA1),
to name and identify objects within its database.
Terms related to GIT are:
Local repository: It is private workplace where developers make changes.
Working directory: It is the place where files are checked out.
Staging area: It is the place where GIT looks for the files while committing the
changes to GIT repository.
Pull: It copies the changes from a remote repository instance to a local one.
Push: It copies changes from a local repository to a GIT repository.
Slide 35 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Basic workflow of GIT is:
Modify the checked out file from the working directory.
Add these files to the staging area.
Perform commit operation that moves the files from the staging area to
GIT repository.
Basic Workflow of GIT
Slide 36 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Detailed workflow of GIT is:
Clone the GIT repository as a working copy.
Modify the working copy by adding/editing files.
Update the working copy by taking other developer's changes, if any.
Review the changes and commit.
Push the changes to the repository.
Detailed Workflow of GIT
Slide 37 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Installing GIT:
Download the software from URL, https://git-scm.com/download/win.
Double-click the setup file. The Git Setup dialog box appears, as shown in the
following figure.
Click the Next button.
The Git Setup Dialog Box
Slide 38 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Click the Next button. The next screen appears, as shown in the following
figure.
Select all the check boxes and click the Next button.
Click the Next button.
The Git Setup Dialog Box
Slide 39 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Click the Next button. The next screen appears, as shown in the following
figure.
Click the Next button in the next screens to install the software.
The Git Setup Dialog Box
Slide 40 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Creating a repository:
Open the git Bash file from the installation directory. The command
prompt window appears, as shown in the following figure.
Type git init myrepository and press Enter. The repository gets
initialized or created, as shown in the following figure.
The Command Prompt Window
The Command Prompt Window
Slide 41 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Some of the GIT commands are listed in the following table:
Command Syntax Description
init git init <directory> Creates a .git subdirectory in the project
root, which contains all of the necessary
metadata for the repository.
init --bare git init -- bare <directory> Initializes an empty git repository, but omit
the working directory.
clone git clone <repo> Copies an existing git repository to local file
system.
git clone <repo> <directory> Copies an existing git repository to the
specified directory.
config git config user.name <name> Defines the author name to be used for all
commits in the current repository.
git config --global
user.name <name>
Defines the author name to be used for all
commits in the current repository by the
current user.
git config --global
user.email <email>
Defines the author email to be used for all
commits by the current user.
Slide 42 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Command Syntax Description
add git add <file> Stages all changes in <file> for the next
commit.
git add <directory> Stage all changes in <directory> for the next
commit.
git add -p lets you choose portions of a file to add to
the next commit.
commit git commit Commits the snapshot in the staging area.
git commit -a Commits a snapshot of all changes in the
working directory.
status git status Lists the files’ status, such as staged,
unstaged, and untracked.
log git log Displays committed snapshots.
git log -n <limit> Limits the number of commits by <limit>.
For example, git log -n 3 will display only 3
commits.
Slide 43 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Some of the GIT Graphical User Interface tool are:
GIT Extension
SourceTree
SmartGit.
GitEye
GitEye:
Is a popular distributed version control and source code management
(SCM) system.
Improves GIT performance through an intuitive graphical interface that
simplifies all GIT commands.
Is pre-integrated with CloudForge, TeamForge and GitHub, and works on
most platforms.
Provides easy access to all GIT functions and repositories, and can be used
with cloud or on-premise GIT repositories.
Slide 44 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Installing and configuring GitEye:
Download the GitEye software from the https://www.collab.net/downloads/giteye
URL.
Unzip and store the files in GitEye folder in your local drive.
Double-click the GitEye.exe file. The CollabNet GitEye window appears, as shown
in the following figure.
The CollabNet GitEye Window
Slide 45 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Creating a new repository:
Click the Create Repository button. The Create a Git Repository dialog box
appears, as shown in the following figure.
Browse the location where you want to create the repository.
Select Create as bare repository if you want to create a blank repository.
The Add Git Repositories Dialog Box
Slide 46 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Click the Finish button. The Git Repositories window displays the newly
created repository, as shown in the following figure.
The Git Repositories Window
Slide 47 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Adding an existing repository:
Click the Add Repository button. The Add Git Repositories dialog box
appears, as shown in the following figure.
The Add Git Repositories Dialog Box
Slide 48 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Browse and select the desired repository. For example, mygit.
Click the Finish button.
Cloning a repository:
Create a user account on the repository’s URL, such as github.com.
Click the Clone Repository button. The Clone Git Repository dialog box
appears, as shown in the following figure.
The Clone Git Repository Dialog Box
Slide 49 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Select the source. For example, GitHub.
Click the Next button.
Select search parameter.
Type a text (for example, app) and click the Search button. Repositories gets
populated, as shown in the following figure.
The Clone Git Repository Dialog Box
Slide 50 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Select a repository and click Next. The Branch Selection page appears.
Select the checkboxes you need.
Click the Next button.
Click the Finish button. The repository gets added to the Git Repositories
window, as shown in the following figure.
The Git Repositories Window
Slide 51 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Modifying a file:
Double-click to checkout the directory or file you want to modify.
Locate the files in your local drive.
Make the changes as per you need.
Save the changes.
You can make the changes in the Working directory.
Pushing a file:
Select the directory or file in the repository.
Go to Git-> Push to Upstream.
Enter your credential.
Click the OK button.
Slide 52 of 55© People Strategists www.peoplestrategists.com
Exploring GIT (Contd.)
Committing changes to the remote repository:
Right-click directory or file you want to commit.
Select Commit. The Commit Changes dialog box appears.
Type the description in the Commit message text area.
Select Files.
Click the Commit button. If files are changed, files will be committed
otherwise “There are no staged files.” error will be displayed.
Slide 53 of 55© People Strategists www.peoplestrategists.com
Summary
In this session, you learned that:
Maven is a tool that can be used for building and managing any Java based
project.
Maven provides collection of jar files known as Maven repositories.
The two types of Maven repositories are:
 Remote repositories
 Local repositories
Maven archetypes allow users to create projects using templates, which are
based on common scenarios.
POM is the fundamental unit of work in Maven.
Version Control System (VCS) is a software that helps software developers to
work together and maintain a complete history of their work.
Two categories of VCS are:
 Centralized Version Control System (CVCS)
 Distributed/Decentralized Version Control System (DVCS)
Slide 54 of 55© People Strategists www.peoplestrategists.com
Summary (Contd.)
Repository is the central place where developers store all their work.
Trunk is a directory where all the main development happens and is usually checked
out by developers to work on the project.
Branches is used to create another line of development.
GIT is a distributed revision control and source code management system.
Local repository is private workplace where developers make changes.
Working directory is the place where files are checked out.
Staging area is the place where GIT looks for the files while committing the
changes to GIT repository.
Pull operation copies the changes from a remote repository instance to a local
one.
Push operation copies changes from a local repository to a GIT repository.
Slide 55 of 55© People Strategists www.peoplestrategists.com
Summary (Contd.)
TortoiseSVN is a centralized version control system that helps to record the
various version of a file.
GitEye is a popular distributed version control and source code management
(SCM) system.
It improves GIT performance through an intuitive graphical interface that
simplifies all GIT commands.
Ad

More Related Content

What's hot (20)

TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4TY.BSc.IT Java QB U4
TY.BSc.IT Java QB U4
Lokesh Singrol
 
Spring Core
Spring CoreSpring Core
Spring Core
Pushan Bhattacharya
 
Struts course material
Struts course materialStruts course material
Struts course material
Vibrant Technologies & Computers
 
Annotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVCAnnotation-Based Spring Portlet MVC
Annotation-Based Spring Portlet MVC
John Lewis
 
TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6TY.BSc.IT Java QB U6
TY.BSc.IT Java QB U6
Lokesh Singrol
 
Ee java lab assignment 4
Ee java lab assignment 4Ee java lab assignment 4
Ee java lab assignment 4
Kuntal Bhowmick
 
Spring andspringboot training
Spring andspringboot trainingSpring andspringboot training
Spring andspringboot training
Mallikarjuna G D
 
TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6TY.BSc.IT Java QB U5&6
TY.BSc.IT Java QB U5&6
Lokesh Singrol
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Struts notes
Struts notesStruts notes
Struts notes
dssreenath
 
Spring IOC advantages and developing spring application sample
Spring IOC advantages and developing spring application sample Spring IOC advantages and developing spring application sample
Spring IOC advantages and developing spring application sample
Sunil kumar Mohanty
 
Spring aop
Spring aopSpring aop
Spring aop
Hamid Ghorbani
 
Struts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web ApplicationsStruts An Open-source Architecture for Web Applications
Struts An Open-source Architecture for Web Applications
elliando dias
 
Servlets lecture1
Servlets lecture1Servlets lecture1
Servlets lecture1
Tata Consultancy Services
 
Introduction to Spring's Dependency Injection
Introduction to Spring's Dependency InjectionIntroduction to Spring's Dependency Injection
Introduction to Spring's Dependency Injection
Richard Paul
 
TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5TY.BSc.IT Java QB U5
TY.BSc.IT Java QB U5
Lokesh Singrol
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
Oleg Tsal-Tsalko
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
Hamid Ghorbani
 
Glassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE IntroductionGlassfish JEE Server Administration - JEE Introduction
Glassfish JEE Server Administration - JEE Introduction
Danairat Thanabodithammachari
 

Similar to Exploring Maven SVN GIT (20)

A-Z_Maven.pdf
A-Z_Maven.pdfA-Z_Maven.pdf
A-Z_Maven.pdf
Mithilesh Singh
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
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
 
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
 
Maven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension toolMaven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension tool
elliando dias
 
Maven Introduction
Maven IntroductionMaven Introduction
Maven Introduction
Sandeep Chawla
 
Maven basics
Maven basicsMaven basics
Maven basics
Vijay Krishnan Ramaswamy
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
Dan Hinojosa
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
Raghavan Mohan
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
Priyank
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
Priyank
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
venkata20k
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
Steve Keener
 
Maven
MavenMaven
Maven
Shraddha
 
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
 
Liferay maven sdk
Liferay maven sdkLiferay maven sdk
Liferay maven sdk
Mika Koivisto
 
Build server
Build serverBuild server
Build server
Christophe Vanlancker
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
Justin J. Moses
 
Maven
MavenMaven
Maven
Fabio Bonfante
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
Angel Ruiz
 
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
 
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
 
Maven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension toolMaven 2.0 - Project management and comprehension tool
Maven 2.0 - Project management and comprehension tool
elliando dias
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
Dan Hinojosa
 
Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
Raghavan Mohan
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
Priyank
 
Maven with Flex
Maven with FlexMaven with Flex
Maven with Flex
Priyank
 
Maven in mulesoft
Maven in mulesoftMaven in mulesoft
Maven in mulesoft
venkata20k
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
Steve Keener
 
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
 
An Introduction to Maven and Flex
An Introduction to Maven and FlexAn Introduction to Maven and Flex
An Introduction to Maven and Flex
Justin J. Moses
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
chrisb206 chrisb206
 
Ad

More from People Strategists (20)

MongoDB Session 3
MongoDB Session 3MongoDB Session 3
MongoDB Session 3
People Strategists
 
MongoDB Session 2
MongoDB Session 2MongoDB Session 2
MongoDB Session 2
People Strategists
 
MongoDB Session 1
MongoDB Session 1MongoDB Session 1
MongoDB Session 1
People Strategists
 
Android - Day 1
Android - Day 1Android - Day 1
Android - Day 1
People Strategists
 
Android - Day 2
Android - Day 2Android - Day 2
Android - Day 2
People Strategists
 
Overview of web services
Overview of web servicesOverview of web services
Overview of web services
People Strategists
 
Spring Framework - III
Spring Framework - IIISpring Framework - III
Spring Framework - III
People Strategists
 
Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
People Strategists
 
Hibernate II
Hibernate IIHibernate II
Hibernate II
People Strategists
 
Hibernate III
Hibernate IIIHibernate III
Hibernate III
People Strategists
 
Hibernate I
Hibernate IHibernate I
Hibernate I
People Strategists
 
Identifing Listeners and Filters
Identifing Listeners and FiltersIdentifing Listeners and Filters
Identifing Listeners and Filters
People Strategists
 
Agile Dev. II
Agile Dev. IIAgile Dev. II
Agile Dev. II
People Strategists
 
Agile Dev. I
Agile Dev. IAgile Dev. I
Agile Dev. I
People Strategists
 
Overview of JEE Technology
Overview of JEE TechnologyOverview of JEE Technology
Overview of JEE Technology
People Strategists
 
JSP Technology II
JSP Technology IIJSP Technology II
JSP Technology II
People Strategists
 
JSP Technology I
JSP Technology IJSP Technology I
JSP Technology I
People Strategists
 
XML Schemas
XML SchemasXML Schemas
XML Schemas
People Strategists
 
JSON and XML
JSON and XMLJSON and XML
JSON and XML
People Strategists
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
People Strategists
 
Ad

Recently uploaded (20)

Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 

Exploring Maven SVN GIT

  • 1. Slide 1 of 55© People Strategists www.peoplestrategists.com Exploring Maven, SVN and GIT
  • 2. Slide 2 of 55© People Strategists www.peoplestrategists.com Objectives In this session, you will learn to: Explore Maven Install and set up Maven Create and build Web application using Maven Manage Dependency Introduce version control system Explore subversion Create repository in subversion Merge code and avoid conflict Explore GIT Explore GitEye
  • 3. Slide 3 of 55© People Strategists www.peoplestrategists.com Exploring Maven Maven: Is a Yiddish word that means "accumulator of knowledge". Is a tool that can be used for building and managing any Java based project. Is based on the concept of a Project Object Model (POM), which is an xml file. Helps Java Developers to understand the structure of a Java-based project by providing a proper directory structure. Provides collection of jar files known as Maven repositories. Provides set of commands to download and make use of Maven repositories. Maven commands can be used from the Windows command prompt.
  • 4. Slide 4 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Maven repositories are used to store constructed artifacts and dependencies of several types. The two types of Maven repositories are: Remote repositories:  Mean repositories accessed by different protocols, such as file:// and http://.  Might be central repositories, which are developed by Maven community, or by a third party to provide their artifacts for downloading.  For example, the repo.maven.apache.org is a central repository and http://maven.objectify-appengine.googlecode.com/git/ is a third party repository. Local repositories:  Refer to a copy of remote downloads on your computer.  Are cache of the remote downloads and contains the temporary build artifacts that you have not yet released. Maven archetypes (readymade templates) allow users to create projects using templates, which are based on common scenarios.
  • 5. Slide 5 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Maven project structure of core application: Project Home Project Structure of Core Application
  • 6. Slide 6 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Maven project structure of Web application: Project Home Project Structure of Web Application
  • 7. Slide 7 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Following table lists the description of the project structure. Folder Description project home Contains the pom.xml and all subdirectories. src/main/java Contains the Java classes for the project. src/main/resources Contains the deliverable resources for the project, such as property files. src/main/webapp Contains the html or jsp files. src/main/webapp/WEB- INF Contains all the configuration files, such as web.xml. src/main/webapp/css Contains all the stylesheet files of the Web application. src/test/java Contains the testing classes (JUnit or TestNG test cases) for the project. src/test/resources Contains resources necessary for testing.
  • 8. Slide 8 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Project Object Model (POM): It was named project.xml in earlier version of Maven. It is the fundamental unit of work in Maven. It is an XML file that contains information about the project. It always resides in the base directory of the project as pom.xml. It also contains the configuration details, such as plugin, goals, build profiles and various dependencies used by Maven to build the project.
  • 9. Slide 9 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Some important terms used in pom.xml are: project: It is the root element for the pom.xml file. modelVersion: It indicates the version of the project object model. groupId: It identifies your project uniquely across all projects. If a user uses your project, it serves as an attribute of the dependency in pom.xml. artifactId: It is the name of your project within Maven and specifies the artifact's location within the repository. version: It refers to the initial maven version of your project. It is used within an artifact's repository to maintain different copy of an application. If you want that your artifact should be using last deployed version, you can suffix the version with –SNAPSHOT. package: It refers to the Java package that is created while creating a project.
  • 10. Slide 10 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) SNAPSHOT: It is a special version that indicates a current development copy of your artifact. Unlike regular versions, Maven checks for a new SNAPSHOT version in a remote repository and fetches the last deployed version for every build. plugin: It defines the plugin you project is using. dependency: It defines the version of the project object model. Maven uses the pom.xml file in the following order: Read the pom.xml file and parse the content. Download dependencies to local dependency repository. Execute life cycle/build phase/goal. Execute plugins, if any.
  • 11. Slide 11 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Two types of the POM are: Minimal POM Super POM
  • 12. Slide 12 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Minimal POM: It contains only the necessary elements, which are:  project  modelVersion  groupId  artifactId  version The following code illustrates the minimal POM: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> </project>
  • 13. Slide 13 of 55© People Strategists www.peoplestrategists.com Exploring Maven (Contd.) Super POM: It is Maven's default POM and can comprise of all the elements. The following code illustrates super POM: <project> <modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <version>1</version> <plugins> <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.3</version> </plugin> </plugins> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> <version>${mavenVersion}</version> </dependency> </project>
  • 14. Slide 14 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven The following table lists the system requirements for installing Maven. Item Requirements JDK Maven 3.2 requires JDK 1.6 or above Maven 3.0/3.1 requires JDK 1.5 or above Memory No minimum requirement Disk 10MB for the Maven installation itself. At least 500MB for your local Maven repository. Operating System No minimum requirement.
  • 15. Slide 15 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To install and set up Maven, You need to perform following steps: Set up JDK Install Maven Set Maven environment variables Configure system path
  • 16. Slide 16 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To set up JDK in windows, you need to perform following steps: Download the latest SDK from the URL, http://www.oracle.com/technetwork/java/javase/downloads/in dex.html. Set the JAVA_HOME path to C:Program FilesJavajdk1.8.0 path. Set the PATH variable to C:Jdk_Folderbin;%PATH%;. To set up JDK in linux, you need to perform following steps: Download the latest SDK from the URL, http://www.oracle.com/technetwork/java/javase/downloads/in dex.html. Type export JAVA_HOME=/usr/local/jdk on command prompt. Type export PATH=$PATH:$JAVA_HOME/bin/ on command prompt. Set up JDK
  • 17. Slide 17 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To install Maven in windows, You need to perform following steps: Go to the URL, http://maven.apache.org/download.cgi to download installation file for your target system. Extract the file to a directory. For example, C:apache-maven. In linux, extract the file to the following directory: /usr/local/apache-maven Install Maven
  • 18. Slide 18 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) To set these in windows, you need to perform following steps: Set M2_HOME to C:apache-maven-install-path. Set M2 to %M2_HOME%bin. Set MAVEN_OPTS to -Xms256m -Xmx512m. To set these in linux, you need to perform following steps: Type export M2_HOME=/usr/local/apache-maven-install-path on command prompt. Type export M2=$M2_HOME/bin on command prompt. Type export MAVEN_OPTS=-Xms256m -Xmx512m on command prompt. Set Maven environment variables
  • 19. Slide 19 of 55© People Strategists www.peoplestrategists.com Installing and Setting Up Maven (Contd.) In order to use Maven command line tools anywhere on a system, we have to add Maven bin directory location to system path. To do this in windows, you need to perform following step: Append the string ;%M2% to the end of the system variable PATH. To do this in linux, you need to perform following step: Type export PATH=$M2:$PATH on command prompt. Configure system path
  • 20. Slide 20 of 55© People Strategists www.peoplestrategists.com Creating and Building Web Application Using Maven Consider a scenario where you need to develop a Web application, helloworld that displays a message “Welcome to Maven World.” For this, you want to use the maven archetype. The expected output of the Web application is shown in the following figure. The Expected Output
  • 21. Slide 21 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work. The Goals of VCS are: It allows developers to work simultaneously. It does not overwrite each other’s changes. It maintains history of every version of everything. Two categories of VCS are: Centralized Version Control System (CVCS) Distributed/Decentralized Version Control System (DVCS)
  • 22. Slide 22 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System (Contd.) Centralized Version Control System (CVCS): Uses a central server to store all files and enables team collaboration. Stores the files on a single machine called server. Some examples are SVN and Perforce. Distributed/Decentralized Version Control System (DVCS): Checks out the latest snapshot of the directory and fully mirrors the repository. Allows any client to copy back the checked out repository to the server to restore it. Does not rely on the central server. Allows you to perform operations, such as commit changes, create branches, and view logs while you are offline. Needs network connection only to publish your changes and take the latest changes. Some examples are GIT and Darcs.
  • 23. Slide 23 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System (Contd.) Some of the VCS terminologies are: Repository:  Is the heart of any version control system.  Is the central place where developers store all their work.  Stores files as well as the history.  Is accessed over a network, acting as a server and version control tool acting as a client. Trunk:  Is a directory where all the main development happens and is usually checked out by developers to work on the project. Branches:  is used to create another line of development.  Is useful to keep separate the new version of a software from the fixes of the old version.
  • 24. Slide 24 of 55© People Strategists www.peoplestrategists.com Introducing Version Control System (Contd.) Working copy:  Is a snapshot of the repository.  Is a private workplace where developers can do their work remaining isolated from the rest of the team. Tags:  Use tag directory to store named snapshots of the project.  Is a descriptive and memorable name given to a specific version in the repository. Commit changes:  Is the act of committing the changes made in the working copy to the repository.  Is rolled back if an error comes in between the process of commit. URL:  Represents the location of the repository on the server.
  • 25. Slide 25 of 55© People Strategists www.peoplestrategists.com Exploring Subversion Subversion (SVN): Is often abbreviated as SVN and falls under CVCS. Is developed as a project of the Apache Software Foundation. Is a software versioning and revision control system distributed under an open source license. Is part of a rich community of developers and users. Is a software that helps software developers to maintain a complete history files. Some of the available SVNs are: SlikSVN (32- and 64-bit client MSI) VisualSVN (32- and 64-bit client and server) WANdisco (32- and 64-bit client and server) TortoiseSVN (32-bit and 64-bit)
  • 26. Slide 26 of 55© People Strategists www.peoplestrategists.com Exploring Subversion (Contd.) To install TortoiseSVN, follow the following steps: Download the software from URL, http://tortoisesvn.net/downloads.html. Double-click the .msi file, the setup dialog box appears, as shown in the following figure. Follow the instructions to install the software. The Setup Dialog Box
  • 27. Slide 27 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion Creating a repository in TortoiseSVN: Create a new folder in your desired drive. Right-click the folder and select TortoiseSVN -> Create repository here. The Repository created dialog box appears as shown in the following figure. Click the Create folder structure button. Click the OK button. The Repository created Dialog Box
  • 28. Slide 28 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) By default, the repository has a folder layout, as shown in the following figure. Right-click the repository and select TortoiseSVN -> Repo-browser. It shows the folders, as shown in the following figure. The Folder Layout Repository Browser
  • 29. Slide 29 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) Adding a project to your repository: Right-click the desired project. Select TortoiseSVN -> Import. The Import dialog box appears. Click the OK button. The project gets imported to the repository. Click the OK button to close the Import dialog box.
  • 30. Slide 30 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) Creating a working directory: Right-click project folder. Select SVN Checkout. The Checkout dialog box appears, as shown in the following figure. Click the OK button to checkout the project. The Checkout Dialog Box
  • 31. Slide 31 of 55© People Strategists www.peoplestrategists.com Creating Repository in Subversion (Contd.) Updating the project with latest version: Right-click project folder in working directory. Select SVN Update. The Update finished dialog box appears. Click the OK button. Committing the changes: Right-click project folder in working directory. Select SVN commit. The Commit dialog box appears. Click the OK button. Reversing the changes: Right-click project folder in working directory. Select TortoiseSVN -> Revert. Select the version you want to revert in the Revert dialog box. Click the OK button.
  • 32. Slide 32 of 55© People Strategists www.peoplestrategists.com Merging Code and Avoiding Conflict Merging a project: Right-click project folder. Select TortoiseSVN -> Merge. The Merge dialog box appears, as shown in the following figure. Select Merge type, which are:  Merge a range of revisions  Merge two different trees The Merge Dialog Box
  • 33. Slide 33 of 55© People Strategists www.peoplestrategists.com Merging Code and Avoiding Conflict (Contd.) Merge a range of revisions merges two versions of a project from one branch to other. Merge two different trees merge the differences of two different branches into your working copy. Click Next. Select revision range, which are:  All revisions: It merges all the revisions.  Specific range: It merges the specified range.  Reverse merge: It merges the versions in reverse order. Click the Next button. Click the Merge button.
  • 34. Slide 34 of 55© People Strategists www.peoplestrategists.com Exploring GIT GIT: Was initially developed by Linus Torvalds for Linux kernel development. Is a distributed revision control and source code management system. Is a free software distributed under the terms of the GNU General Public License. Is fast as most of the operations are performed locally. Uses a common cryptographic hash function called secure hash function (SHA1), to name and identify objects within its database. Terms related to GIT are: Local repository: It is private workplace where developers make changes. Working directory: It is the place where files are checked out. Staging area: It is the place where GIT looks for the files while committing the changes to GIT repository. Pull: It copies the changes from a remote repository instance to a local one. Push: It copies changes from a local repository to a GIT repository.
  • 35. Slide 35 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Basic workflow of GIT is: Modify the checked out file from the working directory. Add these files to the staging area. Perform commit operation that moves the files from the staging area to GIT repository. Basic Workflow of GIT
  • 36. Slide 36 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Detailed workflow of GIT is: Clone the GIT repository as a working copy. Modify the working copy by adding/editing files. Update the working copy by taking other developer's changes, if any. Review the changes and commit. Push the changes to the repository. Detailed Workflow of GIT
  • 37. Slide 37 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Installing GIT: Download the software from URL, https://git-scm.com/download/win. Double-click the setup file. The Git Setup dialog box appears, as shown in the following figure. Click the Next button. The Git Setup Dialog Box
  • 38. Slide 38 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Click the Next button. The next screen appears, as shown in the following figure. Select all the check boxes and click the Next button. Click the Next button. The Git Setup Dialog Box
  • 39. Slide 39 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Click the Next button. The next screen appears, as shown in the following figure. Click the Next button in the next screens to install the software. The Git Setup Dialog Box
  • 40. Slide 40 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Creating a repository: Open the git Bash file from the installation directory. The command prompt window appears, as shown in the following figure. Type git init myrepository and press Enter. The repository gets initialized or created, as shown in the following figure. The Command Prompt Window The Command Prompt Window
  • 41. Slide 41 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Some of the GIT commands are listed in the following table: Command Syntax Description init git init <directory> Creates a .git subdirectory in the project root, which contains all of the necessary metadata for the repository. init --bare git init -- bare <directory> Initializes an empty git repository, but omit the working directory. clone git clone <repo> Copies an existing git repository to local file system. git clone <repo> <directory> Copies an existing git repository to the specified directory. config git config user.name <name> Defines the author name to be used for all commits in the current repository. git config --global user.name <name> Defines the author name to be used for all commits in the current repository by the current user. git config --global user.email <email> Defines the author email to be used for all commits by the current user.
  • 42. Slide 42 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Command Syntax Description add git add <file> Stages all changes in <file> for the next commit. git add <directory> Stage all changes in <directory> for the next commit. git add -p lets you choose portions of a file to add to the next commit. commit git commit Commits the snapshot in the staging area. git commit -a Commits a snapshot of all changes in the working directory. status git status Lists the files’ status, such as staged, unstaged, and untracked. log git log Displays committed snapshots. git log -n <limit> Limits the number of commits by <limit>. For example, git log -n 3 will display only 3 commits.
  • 43. Slide 43 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Some of the GIT Graphical User Interface tool are: GIT Extension SourceTree SmartGit. GitEye GitEye: Is a popular distributed version control and source code management (SCM) system. Improves GIT performance through an intuitive graphical interface that simplifies all GIT commands. Is pre-integrated with CloudForge, TeamForge and GitHub, and works on most platforms. Provides easy access to all GIT functions and repositories, and can be used with cloud or on-premise GIT repositories.
  • 44. Slide 44 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Installing and configuring GitEye: Download the GitEye software from the https://www.collab.net/downloads/giteye URL. Unzip and store the files in GitEye folder in your local drive. Double-click the GitEye.exe file. The CollabNet GitEye window appears, as shown in the following figure. The CollabNet GitEye Window
  • 45. Slide 45 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Creating a new repository: Click the Create Repository button. The Create a Git Repository dialog box appears, as shown in the following figure. Browse the location where you want to create the repository. Select Create as bare repository if you want to create a blank repository. The Add Git Repositories Dialog Box
  • 46. Slide 46 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Click the Finish button. The Git Repositories window displays the newly created repository, as shown in the following figure. The Git Repositories Window
  • 47. Slide 47 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Adding an existing repository: Click the Add Repository button. The Add Git Repositories dialog box appears, as shown in the following figure. The Add Git Repositories Dialog Box
  • 48. Slide 48 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Browse and select the desired repository. For example, mygit. Click the Finish button. Cloning a repository: Create a user account on the repository’s URL, such as github.com. Click the Clone Repository button. The Clone Git Repository dialog box appears, as shown in the following figure. The Clone Git Repository Dialog Box
  • 49. Slide 49 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Select the source. For example, GitHub. Click the Next button. Select search parameter. Type a text (for example, app) and click the Search button. Repositories gets populated, as shown in the following figure. The Clone Git Repository Dialog Box
  • 50. Slide 50 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Select a repository and click Next. The Branch Selection page appears. Select the checkboxes you need. Click the Next button. Click the Finish button. The repository gets added to the Git Repositories window, as shown in the following figure. The Git Repositories Window
  • 51. Slide 51 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Modifying a file: Double-click to checkout the directory or file you want to modify. Locate the files in your local drive. Make the changes as per you need. Save the changes. You can make the changes in the Working directory. Pushing a file: Select the directory or file in the repository. Go to Git-> Push to Upstream. Enter your credential. Click the OK button.
  • 52. Slide 52 of 55© People Strategists www.peoplestrategists.com Exploring GIT (Contd.) Committing changes to the remote repository: Right-click directory or file you want to commit. Select Commit. The Commit Changes dialog box appears. Type the description in the Commit message text area. Select Files. Click the Commit button. If files are changed, files will be committed otherwise “There are no staged files.” error will be displayed.
  • 53. Slide 53 of 55© People Strategists www.peoplestrategists.com Summary In this session, you learned that: Maven is a tool that can be used for building and managing any Java based project. Maven provides collection of jar files known as Maven repositories. The two types of Maven repositories are:  Remote repositories  Local repositories Maven archetypes allow users to create projects using templates, which are based on common scenarios. POM is the fundamental unit of work in Maven. Version Control System (VCS) is a software that helps software developers to work together and maintain a complete history of their work. Two categories of VCS are:  Centralized Version Control System (CVCS)  Distributed/Decentralized Version Control System (DVCS)
  • 54. Slide 54 of 55© People Strategists www.peoplestrategists.com Summary (Contd.) Repository is the central place where developers store all their work. Trunk is a directory where all the main development happens and is usually checked out by developers to work on the project. Branches is used to create another line of development. GIT is a distributed revision control and source code management system. Local repository is private workplace where developers make changes. Working directory is the place where files are checked out. Staging area is the place where GIT looks for the files while committing the changes to GIT repository. Pull operation copies the changes from a remote repository instance to a local one. Push operation copies changes from a local repository to a GIT repository.
  • 55. Slide 55 of 55© People Strategists www.peoplestrategists.com Summary (Contd.) TortoiseSVN is a centralized version control system that helps to record the various version of a file. GitEye is a popular distributed version control and source code management (SCM) system. It improves GIT performance through an intuitive graphical interface that simplifies all GIT commands.