Maven Tutorial – How to create Maven project in Selenium

 

In the previous tutorial, we have discussed about How to install Maven. In this tutorial, we will see How To Create Selenium Maven Project in Eclipse IDE.

Step 1 – To create a project – Click on New and then select  – Project

Step 2 – Select Maven Project and click on Next

Step 3 – Select “Create a simple project” check box and click Next.

If you don’t want to create a Simple project, don’t select the first option. Below screen will appear. Select maven-archetype-quickstart option as shown below and click on Next button.

Step 4 – Mention the Group Id, Artifact Id and click the Finish button

Here, Group Id : MavenDemo

Artifact Id : MavenDemo 

Step 5 – The structure of the project looks as shown in the below image

Step 6 – POM file will look like below image

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>MavenDemo</groupId>
  <artifactId>MavenDemo</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</project>

How to add dependencies to POM.xml file

Step 1 – Please visit website MVN Repository – https://mvnrepository.com/

Step 2 – Type for Selenium Java in search box.

Step 3 – Click on the latest version

Step 4 – Copy the content as shown below and paste in pom.xml of the project

Step 5 – Updated pom.xml will look like the below

Step 6 – Clean and build the project. Click on Project and then select Clean. This will add Maven Dependencies folder to the project.

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 )

Google photo

You are commenting using your Google 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