Continuous Integration with Jenkins, Maven and TestNg with Github on Linux/Ubuntu

Published On: 28 May 2015.By .
  • Quality Engineering

First, Download the jenkins and install.

1. Download latest War file from the jenkins main site http://jenkins-ci.org/

 

Continious integration with jenkins and maven and testng on linux

2. Open Terminal and go to download folder and run

Continious integration with jenkins and maven and testng on linux

3. Now jenkins fully up and running

 

Continious integration with jenkins and maven and testng on linux  3

4. Open http://localhost:8080/

 

Continious integration with jenkins and maven and testng on linux 4

Configure Jenkins with Maven and TestNg
Configure Jenkins with Maven and TestNg

Configure Jenkins with Maven and TestNg

Installing maven

5. Open Eclipse and go to Help > Install New Software

 

Continious integration with jenkins and maven and testing on linux 5

6. Paste given link in “Work With” and click on “Add” button then will display a popup, click on Ok button.

http://download.eclipse.org/technology/m2e/releases

Continious integration with jenkins and maven and testing on linux 6

7. Check on available plug in

 

Continious integration with jenkins and maven and testing on linux 7

8. Click on Next button

 

Continious integration with jenkins and maven and testing on linux  8

9. Accept the agreement and finish it

 

Continious integration with jenkins and maven and testing on linux

10. Will take few minutes to install maven than it will ask to restart eclipse, restart it

11. Install oracle java jdk 7

Continuous Integration with jenkins and maven and testing on Linux  10

12. Check Java path

 

Continuous Integration with jenkins and maven and testing on Linux 11

13. Check the java path

 

14. Open eclipse

Go to New > Other software > Maven > Maven Project click on Next

 

Continuous Integration with jenkins and maven and testing on Linux  12

15. check “Use Default Workspace location”

 

Continuous Integration with jenkins and maven and testing on Linux 13

16. Choose Quick start and click on Next button.

 

Continuous Integration with jenkins and maven and testing on Linux 14

17. Fill data in Group id and Artifact id and Click on Finish

 

Continuous Integration with jenkins and maven and testing on Linux  15

18. It will take some time and it will be ready for work (make sure Java SE version should be 1.7 )

 

Continuous Integration with jenkins and maven and testing on Linux 16

19. Maven with Testng

In maven with testng we assume that you already are working in testng and upgrading to maven .

1. Create a maven project .

2. Except your test package copy all package to src/main/java

3. Copy your test package to src/main/test .

4. Configure your testng.xml file

e.g.

20. Configure pom.xml file

In Pom we have to write all dependencies that you are using in your project and plug in that you are using in your project .
See below code, if you using logging than you have to mention these dependencies .
If you are using another plugin that dependencies not displayed in pom than you should add it in pom file .

 

20. Right Click on Pom.xml >Run as > Maven Test

Related content

That’s all for this blog

Go to Top