Install and Configure Maven

If you are completely a developer and using an IDE like Eclipse to do all your work, then this step might not be needed. However, it is good to have command line Maven too, because on a CI environment when implementing Continuous Test Automation pattern, it would be good to validate that it works from command line once before checking in the code.

Step 1

Download maven from apache website

maven_download

Step 2

Unzip on a local drive. I unzipped to c:\apache…

maven_unzip

Step 3

Now set an environment variable M2_HOME=c:\apache… and append %M2_HOME%\bin to PATH variable. See previous section on how we set JDK_HOME. It is similar. Once you do that, open a command line and type “mvn -version”. It should print something like the below [this will complain if it doesn’t find JDK]

mvn_version

Exceptions

If you are in a corporate/enterprise environment, then you might have to do extra steps like.

  1. %M2_HOME%/conf/settings.xml will be specific to your environment. This is so that connect to an internal maven repository and not necessarily maven central
  2. The conf might point to Nexus or like repositories, so you might have to configure that
  3. We are assuming here that you have access to maven central repository and all other dependent sites access.

Closing Thoughts

In our next section, we will see how to set up eclipse and configure it to get to the development of cucumber-jvm and selenium java world.