Earlier we learnt how to download and Install Maven In eclipse IDE In THIS POST. Another way of using maven with your selenium project Is download It and configure It In windows system Instead of eclipse. There Is nothing to Install but you just need to configure It In your windows system and then you can use It easily for your selenium java project. It Is very easy process. Follow the steps given bellow to configure Maven In eclipse.
Step 1 : Download and Install Java, Set JAVA_HOME Environment variable
First of all, You need to download and Install java In your system. You can view THIS POST to know from where to download java and how to set JAVA_HOME environment variables.
After java Installation and environment variable setting, You need to check that java Is Installed properly or not. To check It, Run java -version command In command prompt as bellow. It will show you java version number. That means java Is Installed properly In your system.
Step 2 : Download Maven
After successful java Installation, You need to download maven from official website of maven. You will find maven download link on THIS SITE. Click on apache-maven-3.2.5-bin.zip link(Maven version may change In future) to download maven as shown In bellow Image,
It will download Maven In zip folder. Extract the folder, You will get folder like "apache-maven-3.2.5" from It based on your downloaded maven version.
Step 3 : Set environment variable for maven
To set maven environment variable,
- Go to your system properties window by right clicking on computer Icon. It will open window as shown In bellow Image.
- Click on Advanced system settings. It will open system properties window.
- From advanced tab, Click on Environment Variable button. It will open Environment Variable window.
- In Environment Variable window, Click New button In System variable section. It will open New System Variable popup.
- In New System Variable popup, Enter variable name = M2_HOME and Variable Value = path of apache-maven-3.2.5 folder. For me It Is "E:\Help and jar files\apache-maven-3.2.5". Then click on OK button. It will set environment variable for maven as shown In bellow Image.
Step 4 : Set Path variable
You needs to set path variable for maven. You will find path variable In Environment Variable popup. You need to set maven bin folder path In path variable as bellow. To set It, Select Path variable and click on Edit button. It will open Edit System Variable popup. Add ;(semicolon) and then maven bin folder path at end of path variable string.
For me It Is ;E:\Help and jar files\apache-maven-3.2.5\bin
After set path variable, click on OK button. Then close all popup by clicking on OK buttons. Maven configuration part Is over now.
Verify maven configured/Installed properly or not
To verify that maven Is configured properly or not, You need to run bellow given command In command prompt. It will show you maven version as shown In bellow Image. That means maven Is Installed properly In windows.mvn -version
Now maven Is configured properly In my windows system. Next post will describe you how to create/setup maven project from command prompt for selenium test.