Maven Installation on Ubuntu

How to Install Maven ?


JAVA 1.5 or above. 

Follow the given link to see how to install java and set environment for Java in Ubuntu.

Installation of Maven on Ubuntu can be pretty straightforward 

Type the below commands on terminal.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install maven

It takes few minutes to download, patient. 


Type “mvn -version” to verify the installation.
$ mvn -version

Output should something like this-

Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /opt/jdk1.8.0_131/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-83-generic", arch: "amd64", family: "unix"

Where the Maven installed?

The apt-get installation will install all the required files in the following folder structure-

  1. /usr/bin/mvn
  2. /usr/share/maven/
  3. /etc/maven   (this is the maven configuration location)

Using maven behind proxy
To use maven behind the proxy we have to define the proxy setting in setting.xml  file inside the proxy element.

The setting file is found in /etc/maven/setting.xml

Add the following line under proxy element

What is Maven ?

No comments:

Post a Comment