Add java libraries

1/5 - (3 votes)

What is Maven in java?

Maven is the mighty management automation tool used to manage the whole project. Maven is not installed in the Windows service. Maven is configured using the Windows environment variables. Maven project contains the .xml file named pom.xml file.

Maven manages all project dependencies.

Maven manage all libraries used. For Example Selenium Jars

 

USING MAVEN TO MANAGE PROJECT LIBRARIES

Now After creating the new project pom.xml tab is open. And now we are going to add a dependency tag that contains libraries in the pom.xml file.

Now we need Selenium Java Maven dependency libraries in the pom.xml file.

 

Go to the URL

https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java

 

Click on the latest version with the most usage as mentioned in the image.

 

 

Now Copy the dependency

Dependency Tag

<dependencies> 

<!– https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java –>

<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-java</artifactId>

    <version>3.141.59</version>

</dependency>

</dependencies>

 

Now Add the copied dependency under the tag.

 <dependencies> 

 

</dependencies>

 

 paste the above dependency code in the XML file as mentioned.

Now click on the load Maven button to save the changes.

Now

Click on the External Libraries to view all the external libraries uploaded successfully.

 

In the next lecture, we will learn how to set up a chrome driver.