Maven Setup

Tuesday, 24 December 2013, 16:36

Tags: Maven

Setting up maven is pretty easy, it only requires a few simple steps.

  1. Maven is written in Java and thus needs Java to run. Install the verion of Java you would like to use. I use Java SE Development Kit because it also includes tools for developing, debugging and monitoring java applications such as Java Mission Control, JVisualVM, JConsole, ...
  2. Download the latest Maven version and unzip it.
  3. Set JAVA_HOME environment variable to the location of your Java installation.
  4. Set M2_HOME environment variable to the location of your Maven installation.
  5. Add the Maven bin folder to PATH environment variable to be able to run the mvn command from the command line.

The following example shows the commands to execute to set the environment variables and adapt the path.

To check whether the configuration was successful mvn -v can be executed. When everything is configured correctly Maven and Java version information is printed out.