Jenkins integration with Github and Maven

Start the Jenkins service using the java -jar jenkins.war command in the command prompt Go to the Jenkins dashboard at localhost:8080

image.png

Click on the new item option Select the maven project option Give a name to the project Click ok

image.png

You will be directed to a page similar to this. Click on the source code management tab to add the github repository

image.png

Visit the repository where you saved your maven project Copy the location of the github repository

image.png

In the Source Code Management Section select Git Give the repository location in the specified placeholder

image.png

Go down to the Build Section Add the exact location to the pom.xml file. If it is inside some folder, specify it as {folder_name}/pom.xml In the goals specify “clean, test and install” as the maven goals Click save and apply

image.png

You would be redirected to a dashboard below like this:

image.png

Click on Build Now option to build the project. Select the console output option to check how the build is running

If the build runs successfully it would return “BUILD SUCCESS”. It would return failure in case of any errors in the project

image.png