Home » Enterprise Java » Maven » How to install Maven on Ubuntu

About Sotirios-Efstathios Maneas

Sotirios-Efstathios Maneas
Sotirios-Efstathios (Stathis) Maneas is a PhD student at the Department of Computer Science at the University of Toronto. His main interests include distributed systems, storage systems, file systems, and operating systems.

How to install Maven on Ubuntu

In this tutorial, we will show you an easy way to install Apache Maven 3 on Ubuntu 12 and Ubuntu 13 releases.

1. Search for the Apache Maven package in Ubuntu Repositories

Open a terminal and execute the command:
 
 
 
 

$ apt-cache search maven

in order to get  a list with all available packages, related to Maven.

mvn_search_WM

The maven package contains the latest version of the Apache Maven for Ubuntu.

2. Install the Appropriate Package

Execute the command:

$ sudo apt-get install maven

in order for the latest version of the Apache Maven to get installed on your computer.

mvn_install_WM

Depending on your internet connection, the installation may require a few minutes to finish.

3. Verify the Installation

To verify your installation, execute the command:

$ mvn -version

If the installation has been completed successfully, you shall see a similar output, depending on the installed version of Java and Ubuntu:

mvn_version_WN

By default, the apt-get command, installs the Apache Maven software in /usr/share/maven. You can inspect the elements of the created folder by executing the command:

$ ls -l /usr/share/maven/

The contents of the newly created folder are the following:

mvn_home_WM

Finally, the apt-get command, also installs some configuration files for Apache Maven, in the folder /etc/maven. You can inspect the elements of the created folder by executing the command:

$ ls -l /etc/maven/

The contents of the newly created folder are the following:

mvn_config_WM

This was an example on how to install Apache Maven on Ubuntu.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design

 

and many more ....

 

 

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns