Friday, October 3, 2014

How to install Maven on Ubuntu

  1. Extract the distribution archive, i.e. apache-maven-3.2.3-bin.tar.gz to the directory you wish to install Maven 3.2.3. These instructions assume you chose /usr/local/apache-maven-3.2.3.
  2.  Edit the profile file, to add environment variables
    1. sudo gedit /etc/profile
  3. Add to the end
    1. #MAVEN
      M2_HOME=/usr/local/apache-maven-3.2.3
      M2=$M2_HOME/bin
      PATH=$M2:$PATH

      export M2_HOME
      export M2

      export PATH
  4.  To update the environment:
    1. source /etc/profile 
    2. . /etc/profile  (with the space)
  5.  Run mvn --version to verify that it is correctly installed.

No comments:

Post a Comment