Saturday, December 3, 2016

DevOps - Continuous Integration : SCM (Git, Github) -> Build Automation (Maven) in Jenkins

Git – Source Control Management

Linus Torvalds created Git in 2005. It’s a version control system freeware. Git works well with non-linear and distributed development. Git gives clone of full development history to each developer. It’s lightweight and support rapid branching & merging.

Git download is available at https://git-scm.com. Image file package installs Git into a default directory of (/usr/local for mac OS) the server with an option to change the directory.

Configuring Git in Jenkins –

Git is configured in CI tool Jenkins as default plugin. If not, it can be configured using option - manage Jenkins -> manage plugin ->


Click ‘available’ tab -> search & select Git plugin -> click ‘download now & install after restart’- submit button. This will configure Git in your Jenkins.


A project is created in Jenkins with Git as SCM using option – new item -> update project name as new item name -> select freestyle or maven project -> press ok ->


Select Git in ‘Source Control Management’ section -> update your Git repository URL in repository URL field -> press apply & save button.


Now, project is ready to build.

Github – Source Control Management

Chris Wanstrath, PJ Hyett & Tom Preston werner launched github in 2008 as repository hosting service which offer all the VCS & SCM functionality of Git with some additional features like bug tracking, wikis & task management.

Github url is https://github.com. It offers private and free repositories.

Configuring github in Jenkins –

Github is configured in CI tool Jenkins as default plugin. If not configured, it can be done using option - manage Jenkins -> manage plugin -> Click ‘available’ tab -> search & select Github plugin -> click ‘download now & install after restart’- submit button. This will configure Github in your Jenkins.

A project is created in Jenkins with Github as SCM using option – new item -> update project name as new item name -> select freestyle or maven project -> press ok -> update Github project URL under general Github project – project URL ->


Select Git in ‘Source Control Management’ section -> update your Github repository URL in repository URL field -> press apply & save button.


Maven – Build Automation

Maven is a build automation tool. Maven manages build, reporting and documentation using a project object model (POM).

Maven download is available at https://maven.apache.org. Image file package installs Maven into a local directory of the server by default.

Configuring Maven in Jenkins -

Maven is not available as default plugin in Jenkins. Maven is configured in Jenkins using option - manage Jenkins -> manage plugin -> Click ‘available’ tab -> search & select Maven integration plugin -> click ‘download now & install after restart’ submit button.

Then, manage Jenkins -> global tool configuration -> under JDK section update JDK version in JDK name -> update jdk location of your server in JDK_HOME ->


Under Maven update Maven version in Maven name -> update maven location of your server in Maven_HOME. This will configure Maven in your Jenkins.


A maven & Github project is created in Jenkins using option – new item -> update project name as new item name -> select maven project -> press ok -> update Github project URL in project URL field under general & Github project -> Select Git in ‘Source Control Management’ section -> update your Github repository URL in ‘repository URL’ field -> check ‘resolve dependencies during POM parsing’ under build section -> press apply & save button ->


Create POM xml with required instruction and save the POM xml file in the Github repository.


Now, a Maven Github project is ready to build.


1 comment: