How to integrate Maven Project from Bitbucket to Continuous Integration Jenkins
First, let’s understand what Continuous integration is. It’s a process which allows you to identify errors in the starting. All development work is integrated as early as possible and artifacts are created and tested automatically.
Now, what is Bitbucket?
Bitbucket is the most commonly used tool for version control system, the whole team can add and commit the test scripts that are developed locally and push the changes to the bit.
How is Jenkins used?
Jenkins is a widely used open source tool to perform continuous integration and build automation. It monitors the execution of the steps and allows to stop the process if one of the steps fails.
Jenkins can pull the source code from Bitbucket server by selecting the option of source code management and specify the SSH key and can find the source code of your project.
Now we will take you through the process step by step.
- To setup Jenkins, first of all, you have to download Jenkins.war file from the link- https://jenkins.io and copy that file to your c drive.
- Open a command prompt and execute —
java –jar c:/ jenkins.war
- When the installation is complete the browser will be launched. If it doesn’t, open a browser- To browse http://localhost:8080
- To unlock Jenkins page, paste this password into the Administrator password field and click Continue.
- When Jenkins is up and running you can click on Manage Jenkins.
- After that click on Manage Plugins.
- Move to Available tab
- Search for Maven Integration plugin and Bit Integration by clicking on the checkbox.
Maven Integration plugin will allow you to add a maven project and Bit Integration plugin will allow you to pull source code from the repository.
- Then click install without start and wait for the installation, then click on restart.
- Comeback to Manage Jenkins page.
- Click on Global Tool Configuration.
- Click on JDK Installations.
- Now add the JDK path.
- Click on Add Git and add the Git path.
- Click on Maven installations and add the Maven path.
- Click on save. The configuration is done. Now you just need to create a Maven project.
- To create a new Project, you have to Move to Jenkins dashboard and click on Create New Job.
- Just provide any Name for Project and select Maven Project for creating a maven project and then click on Ok.
- Select Git in Source Code Management and enter your repository clone SSH/HTTPS URL and add a valid username and password in credentials.
- Scroll Down to Build under this in Goal and Options. Enter clean install or as you need.
- Click on Save.
- Now you can click on Build and whenever you click on build, Jenkins will pull the latest commit source code from Bitbucket and generating a build. Also, it will generate a test report of that execution.Hope you got some insight on how to integrate Maven Project from Bitbucket to Continues integration Jenkins and found our tips useful. Suggestions are always welcome and appreciated.