Continuous Integration and Deployment — Jenkins integration with Github And Maven
Welcome back! In the last tutorial, we integrated Github with Jenkins, but now we are going to Integrate both Github and Maven simultaneously.
For this, we have to install the following plugin:
Now, we have to give the path where the maven is installed in global tool configuration.
Now, in Jenkins, we have installed the Maven Plugin. Now, you will get a Maven Project option while selecting the project. It will look like this: (See the second option).
Now, follow the below steps:
Select the maven project option.
Give a name to the project.
Click ok and the configuration dashboard will open.
Now, click on the source code management tab to add the Github repository.
The following screenshot is of the Github project that I have used. The project is of Maven and contains pom.xml file in it.
So, this repository I have used in Integrating Maven with Jenkins.
Now, after we have done the configuration, one last part is left.
In the goals section specify any one of “clean, test or install” as the maven goals. Any of your choice. It will execute the one that you have chosen.
Click save and apply.
After following the steps, You would be redirected to a dashboard like below.
Now, click on Build Now, AS SHOWN IN THE FIGURE ABOVE.
It will start building the maven goals and executing them. Select the console output option to check how the build is running.
BUILD SUCCESS shows that the build has executed successfully. If there were any errors in my project, it will show as BUILD FAILURE.
Look at the following screenshot to check the final state of the project and build.
Congratulations, you have finally integrated Maven and Github with Jenkins. Stay tuned as many more tutorials are in store.