top of page

Maven Tutorial

Creating A New Maven Project

How To Create A Maven Project In Eclipse ?

In Eclipse, click on the File and select New then click on Other..
Here select 'Maven Project' and move to Next.






Check the box of 'Create a simple project' and click Next.
Enter 'groupId' and 'artifactId' for your project and hit the Finish Button.



Now the project is created and by default pom.xml is generated as :

Create a package under src/main/java


Add selenium dependencies in pom.xml from here.


Create a class in this package and write a test in selenium.

package mavenexamples;

import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;

public class MavenDemo {

public static void main(String[] args) { // TODO Auto-generated method stub System.setProperty("webdriver.chrome.driver", "..\\MavenTestExamples\\src\\main\\resources\\drivers\\chromedriver99.exe"); WebDriver driver = new ChromeDriver(); driver.get("https:\\www.google.com"); driver.close(); }

}


Maven project has been created successfully.
Run as 'Java Application'.





bottom of page