Maven Project Setup Guide

Step:-(1).Java Installation.

a.)-->Goto http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

b.)-->Accept License Agreement under "Java SE Development Kit 8u121"

c.)-->Download jdk as per OS requirement.e.g. For Windows x86-->jdk-8u121-windows-i586.exe

d.)-->Install it and set Environment variable under System level
For This..:GoTo
-->My Coumpter-->Properties-->Advance System Settings-->Environment Variable-->Under System level-->Edit-->Copy and paste the bin directory found in java(JDK) folder under ProgramFiles .
Set JAVA_HOME variable =C:\Program Files\Java\jdk1.8.0_101

And Path=;%JAVA_HOME%\bin
    
Note:Check whether java installed correctly or not-->GoTo start menu-->cmd-->Type java -version

Step:-(2).Eclipse Installation

a.)-->Goto http://www.eclipse.org/downloads/packages/release/Luna/SR2

b.)-->Download Eclipse IDE for Java EE Developers

c.)-->Extract Downloaded file and find eclipse icon application file -->Rigth click-->Create shortcut on desktop/Or pin to task bar-->

Step:-(3)Maven Setup

a.)-->Goto http://maven.apache.org/download.cgi

b.)-->Download Binary zip archive-->apache-maven-3.3.9-bin.zip

c.)-->Unzip it to the folder you want to install Maven.
-->Assume you unzip to this folder – C:\Program Files\Apache\maven

Note:-->That’s all, just folders and files, installation is NOT required.

d.)Add both M2_HOME and MAVEN_HOME variables in the Windows environment, and point it to your Maven folder.

i.e. M2_HOME= C:\Program Files\Apache\maven and MAVEN_HOME=C:\Program Files\Apache\maven

e.)Update Path variable-->Append Maven bin Folder - > %M2_HOME%\bin;

Note:Verification -->run mvn -version in the cmd.

Step:-(4)Selenium and testNg Setup.

a)TestNg setup
I.)GoTo-->Eclipse-->Help-->Eclipse Marketplace-->type testNg and Go to search.
You will find TestNG for Eclipse.
II.)Install it.
Note:Verify-->Goto eclipse -->Preferences and check, TestNg is present or not.
b.)Selenium setup
I.Goto http://www.seleniumhq.org/download/
II.Download For Java Language.
III.Add all required jar file in project.
Step:(5)Git Installation for Window.
a.)Goto https://git-scm.com/downloads

b.)Download as per OS requirement.

c.)Install it.

1.)Under Select Components--> Additional Icons-->On The Desktop
2.)Under Adjusting Your PATH environment-->Run git and included Unix tools from the  Windows Command Prompt.


OR


a.)GoTo https://github.com/git-for-windows/git/releases/tag/v2.12.0.windows.1

b.)Under download--> Download ,"Git-2.12.0-32-bit.exe"

-->
Once you have downloaded the msysGit executable, double click on it to start the installation wizard. Leave the default directory options. When you get to the “Adjusting your Path environment” setting, select the “Run Git from the Windows Command Prompt” option. Choosing this option will make it easy for you to run Git commands from the Windows Command Prompt (command line) if you choose. Command Prompt is a simple tool, where you can run commands, switch through folders, manage files and it can be ran by selecting RUN… in START menu, and executing cmd command.

You will notice that for the rest of this article we will use Git Bash for running Git commands. The Git Bash tool works in the same way as the default Windows’ Command Prompt, but has some special features. With Git Bash you’ll be able to use a number of UNIX command line tools along with access to Git, and we recommend it since it’s often simpler to use than the Windows Command Prompt.

You can run it by right clicking your mouse on the desktop, and selecting Git Bash from pop up window.

Now you can run git command.

=======>Clone the project<============

git clone "HTTP Address"


Steps:-(6).Import Project 

a.)Goto Eclipse -->File-->Import-->Existing Maven Projects.

Or

    Goto Eclipse-->File-->Import-->Existing Java Projects-->Convert it in Maven Project

If some problem exist with project then update maven project.

Goto cmd type ==> mvn clean install -U

-U means force update of dependencies.

OR----->

If you are getting error like
An internal error occurred during: "Updating Maven Project".
Unsupported IClasspathEntry kind=4

This is all you need:

1.)Right-click on your project, select Maven -> Remove Maven Nature.
2.)Open you terminal, navgate to your project folder and run mvn eclipse:clean
3.)Right click on your Project and select Configure -> Convert into Maven Project
4.)Right click on your Project and select Maven -> Update Project

Comments

Popular posts from this blog

API Automation using Rest Assured

Security Testing

Manage Jenkins