Maven

Posted on Posted in Selenium Java

 

Motivation Problem

There are two issues that you would have faced till now in doing Selenium Development

  1. In Parallel Development, managing the dependency on Selenium JARs is a pain.  Either we’ve to commit them into GITHUB or need to share them in a standard path.
  2. For every new selenium project in Eclipse, Download and Add Selenium JARs.

Maven Solves above two problems very well.

  1. You are no longer required to download JAR files (transitive dependency management).
  2. Uses single shared repository for all our projects for sharing jars.

What is Maven?

Maven is a build automation tool.  Without eclipse, we can compile our code by auto dependency resolution to get ARTIFACT (component) generated.

What are other choices?

ANT, Ivy, Gradle etc.

ANT vs Maven?

ANT is mainly a scripting tool and requires lot of coding and configuring tasks.

MAVEN is a full fledged build tool.  Uses Convention over configuration.

Installing Maven

It is just a 4 Step process.

  1. Download Maven Binary Distribution.
  2. Unzip the downloaded file.
  3. Add bin directory of maven to PATH environment variable.
  4. Set JAVA_HOME environment variable is set to point to JDK installation directory and MAVEN_HOME to point to Maven unzipped directory.

We are all set.  To verify all’s well, open command prompt and run ‘mvn -version’ command.