Saturday, 12 August 2017

How to Install Maven?

How to Install Maven?

Prerequisite
Steps to Install Maven

1) Download Maven from link and unzip it at your preferred location.
  • apache-maven-3.5.0-bin.zip for Windows
  • apache-maven-3.5.0-bin.tar.gz for Linux
  • apache-maven-3.5.0-bin.tar.gz for Mac
2) Now you need to set Maven environment variables
Add MAVEN_HOME, MAVEN, MAVEN_OPTS to environment variables.

  • For Windows, set the above environment variables.
    MAVEN_HOME=MAVEN unzip directory path\apache-maven-3.5.0MAVEN=%MAVEN_HOME%\binMAVEN_OPTS=-Xms256m -Xmx512mAppend the string ;%MAVEN% to the end of the system variable, Path.
  • For Linux, open command terminal and set the above environment variables.
    export MAVEN_HOME=MAVEN unzip directory path\apache-maven-3.5.0export MAVEN=%MAVEN_HOME%\binexport MAVEN_OPTS=-Xms256m -Xmx512mexport PATH=$MAVEN:$PATH
    • For Mac, open command terminal and set the above environment variables.
    • export MAVEN_HOME=MAVEN unzip directory path\apache-maven-3.5.0
      export MAVEN=%MAVEN_HOME%\bin
      export MAVEN_OPTS=-Xms256m -Xmx512m

      export PATH=$MAVEN:$PATH


        3) Verify Maven installation
        • For Windows, open command console and type "mvn --version". If you've done the setup correctly, this command will provide you the version of installed Maven. 
        • For Linux, open command terminal and type "mvn --version". If you've done the setup correctly, this command will provide you the version of installed Maven.
        • For Mac, open terminal and type "mvn --version". If you've done the setup correctly, this command will provide you the version of installed Maven.

        Congratulations! you have successfully done the Apache Maven setup for all your projects.

        Labels: , , , , , , , , , ,

        How to create a Maven Project using Eclipse?

        How to create a Maven Project using Eclipse?
        Maven is a software project management, reporting manager, build, documentation and much more managing tool. I personally prefer this tool in almost every Java project. Maven supports JAVA programming language, you may not get this support for any other programming language Like RUBY. Maven provides an XML file 'pom.xml' where you can mention the dependencies of the jar files required for the software project. I will mention you the details below in steps that how easily you could do that. Do not waste much more time on the theory, you can get the theory from any other portals easily.

        Prerequisite before start with selenium

        1) Eclipse IDE link to download Eclipse

        2) Install Java JDK How to setup java

        3) Install Maven link.

        3) Use Maven Dependencies of Selenium Webdriver (Described below)

        Steps to Create a Maven Project:-

        1) Select "Maven Project" option


        2) Make sure Archetype should be maven-archetype-quickstart, usually, it is a default selected.And then also mention Group id and Artifact id of the software project and click Finish.


        3) You will able to see a below structure if  Maven project created successfully.



        4) As you can see in the above image that Maven project has a pom.xml file, and open structure of pom.xml is like in below image

        5) You can mention the require jar file dependencies in middle of<dependencies> and </dependencies>

         6) Congratulations, Now your Maven software project is ready to do Test Automation.

        Leave comments if you still face challenges 

        Labels: , , , , , , , ,