Creating First Maven Project in Eclipse

Here  i am posting new post to create new maven project that i have learned from various sites and blot  and i got this very useful and want to share this with people who are also like me, and has started learning Selenium from scratches.

1- In Eclipse File ->New-> Other-> Maven-> Maven Project

2- Now Click Next, Next and Next
3- Type in field Group Id: com.Projectgroup.selenium Example com.Dwarika.selenium
4-Type in field Artifact Id: projectname Example : Webdriver
5-Click: Finish

After this you will see the hierarchical structure like this in Eclipse  where you would be able to see pom.xml in which you put all dependencies for your Maven Project

In Above snap number 4 you would be able to see the dependencies for junit and Slenenium

Dependencies that we need to change as per the use

1) We will change junit version to 4.7 or recent one is 4.9

in my case i have taken version for junit is 4.7

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.9</version>
  <scope>test</scope>
</dependency>

To add dependecy for Selenium we need to put this like given below

  org.seleniumhq.selenium
  selenium-java
  2.6.0

-- Here Eclipse will detect changes in pom.xml automatically and will download or update all dependencies as per the requirement 
-- After the build is finished, there should be selenium*.jar files under Maven Dependencies under the explorer pane
About these ads

6 thoughts on “Creating First Maven Project in Eclipse

  1. Oh my goodness! Impressive article dude! Many thanks,
    However I am experiencing issues with your RSS. I don’t understand the reason why I cannot subscribe to it. Is there anybody else having the same RSS issues? Anybody who knows the answer can you kindly respond? Thanks!!

    • in place of junit place testng everywhere between groupid and artifactid tag in version tag place 6.8 and keep scope same as test.
      In the same way place org.seleniumhq.selenium between groupid tag and
      selenium-java in artifactid tag and in version tag put 2.30.0.

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