How to install Maven Plugin in Jenkins

HOME

In this tutorial, we are going to learn how we can install the Maven plugin and can create a Maven project in Jenkins.

Implementation Steps

Step 1: Create a project for running the tests using Selenium WebDriver and TestNG

Step 2: Create the Test Code

You can refer to this tutorial to get the test code – Integration Of Jenkins With Selenium WebDriver.

Step 3: Start the Jenkins server

Open the browser and navigate to the localhost and the port in which Jenkins is running.

http://localhost:8080/

Step 4: Log in to Jenkins UI

Provide username and password and click on Sign in.

Step 5: Download and Install Maven Plugin

Click on the Manage Jenkins.

Choose Manage Plugins.

Step 6: Add the Maven Integration plugin

On the Plugins Page, go to the Available option

  1. Select the Maven Integration Plugin
  2. Click on Install without restartThe plugin will take a few moments to finish downloading depending on your internet connection, and will be installed automatically.
  3. You can also select the option Download now and Install after the restart button. In which plugin is installed after the restart
  4. You will be shown a “No updates available” message if you already have the Maven plugin installed.

The plugin “Maven Integration” has been installed successfully.

Step 7: Restart Jenkins

Click on the checkbox “Restart Jenkins when installation is complete when no jobs are running“.

The Jenkins is being restarted, It is about to restart.

Again, log in to Jenkins UI.

Step 8: Create a new project using the Maven project plugin

  1. Give the Name of the project.
  2. Click on the Maven project. 
  3. Click on the OK button.

In the General section, enter the project description in the Description box.

Step 9: Build Management

Go to the Build section of the new job.

  • In the Root POM textbox, enter the full path to pom.xml
  • In the Goals and options section, enter “clean test

Click on Apply and Save buttons.

We have created a new Maven project SeleniumTestNG_MavenDemo” with the configuration to run the Selenium with TestNG Tests

 Step 10: Execute the tests

Click on the Build Now link. Maven will build the project. It will then have TestNG execute the test cases.

To see the current status of the execution, click on the “console output“.

Congratulations on making it through this tutorial and hope you found it useful! Happy Learning!! Cheers!!

Additional Tutorials on Jenkins

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s