Setup Maven and TestNg with Selenium on jenkins server with Git

1.Run Apache server and run http://localhost:8080/jenkins/

2. Install Maven 3 by below commands

3.Go to Manage Jenkins  Displayed a button that “Setup Security” Click on it or you can Dismiss it.

4.if want to Setup the “Setup Security” thank Click on “Enable Security”

5.In Security Realm Choose “Jenkins own user databases”

6.Choose Logged in users can do anything  (you can choose according to your requirement

7.Click on Save and Apply

8.After run maven Go to “Manage jenkins > Manage plugins > Available ”

9.Check on “Git Plugin”  than click on Install without restart.

10.Wait until plugin install.

11.Click on New Item >> Choose Maven Project give name of project.

Configure jenkins with Maven and testing 1

12.Come to Source Code Management choose Git.
Enter your git repository url and add user name and password.

Configure jenkins with Maven and testing 2

13. Leave “Branch to build” as it as.

14. Build Triggers , Choose according to your need . e.g. Build when a change is pushed to GitHub

Configure jenkins with Maven and testing 3

15. Come to “Build” and displayed a error message that “Jenkins needs to know where your Maven is installed . Please do so from the system configuration “ click on “the system configuration” .

16.Come to JDK > Add Jdk >> ucheck Intall automatically and enter System JDK home
Name : java 1.7
JAVA_HOME : /usr/lib/jvm/java-7-openjdk-amd64  

17.After go to Git and enter git path .
Path: /usr/bin/git

Configure jenkins with Maven and testing 4

18.Come to maven uncheck “Install automatically” and enter maven path .
Name : Maven
Maven_Home : /usr/share/maven3/

Configure jenkins with Maven and testing

19. Come to Git plugin and enter git user-name and git email id.

Configure jenkins with Maven and testing

Click on save and Apply .
Come to “Build” and enter Pom.xml file path into “Root POM” After project name enter path .

Configure jenkins with Maven and testing

20.Click Save and Apply .

Comments