How to install Maven on Ubuntu

In this tutorial, we will show you how to install Apache Maven 3 on Ubuntu 12.

1. Search Maven package

In a terminal, run apt-cache search maven, to get all the available Maven package.

Bash
$ apt-cache search maven
....
libxmlbeans-maven-plugin-java-doc - Documentation for Maven XMLBeans Plugin
maven - Java software project management and comprehension tool
maven-debian-helper - Helper tools for building Debian packages with Maven
maven2 - Java software project management and comprehension tool

The maven package always comes with latest Apache Maven.

2. Install it

Run command sudo apt-get install maven, to install the latest Apache Maven.

Bash
$ sudo apt-get install maven

It takes few minutes to download, patient.

3. Verification

Run command mvn -version to verify your installation.

Bash
$ mvn -version
Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_09, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.5.0-17-generic", arch: "amd64", family: "unix"

The Apache Maven is installed successfully.

Where is Maven installed?
The command apt-get install the Maven in /usr/share/maven.
Bash
$ls -ls /usr/share/maven
total 16
4 drwxr-xr-x 2 root root 4096 Dec  7 01:28 bin
4 drwxr-xr-x 2 root root 4096 Dec  7 01:28 boot
0 lrwxrwxrwx 1 root root   10 May 28  2012 conf -> /etc/maven
4 drwxr-xr-x 2 root root 4096 Dec  7 01:28 lib
4 drwxr-xr-x 2 root root 4096 Dec  7 01:28 man

The Maven configuration files are stored in /etc/maven

Bash
$ls -ls /etc/maven
total 16
 4 -rw-r--r-- 1 root root   184 Jan 21  2012 m2.conf
12 -rw-r--r-- 1 root root 10224 Jan 21  2012 settings.xml
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值