Maven basics and environment variables setup

Maven runs on community server. All the latest jar files from all the open source distributors ,may it be Selenium jar files from Selenium or any ther jar files from Ant ,poi api or any other soap or rest api related jar files are uploaded in a centralized repository on server.So we don't have to download these jar files and add them to our project. We can just create a Maven project and add which ever files we need to our pom.xml file in the project. We can even provide the version number we want to use for any of those files.

Before creating a maven project we need to do this the very first time, i.e we need to set up the env variables for maven. We will download the latest version of maven and save anywhere on our Pc. we are using the version 3.3.9 in this example.

1.Go to My Computer Properties->Advanced Properties-->Environment variables 2.Make a new variable and name it M2_HOME and give the address where we saved Maven to our system C:\apache-maven-3.3.9 3.Then go to Path variable and put a ; in the end and then paste the following after that C:\apache-maven-3.3.9\bin i.e adress of the bin folder where our Maven is saved 4.Then create a JAVA_HOME variable(if not already present) and give address as C:\Program Files\Java\jdk1.8.0_65