You may like:

How to Install Gradle on Ubuntu 18.04

Step 1 – Prerequisites

First of all, you make sure that you installed appropriate Java on your system.Java is the primary requirement of installing Apache Maven on nix systems. So firstly you need to install Java on your system also make sure you have installed JDK and JRE both. If you don’t have Java Development Kit installed on your system. Visit install Java 11 on Ubuntu

Step 2 – Install Maven on Ubuntu

After verifying java version on your system. Download Apache maven from its official website or use following command to download Apache Maven 3.6.3. Now extract downloaded archive using following command.

Step 3 – Setup Environment Variables

As you have downloaded pre compiled Apache Maven files on your system. Now set the environments variables by creating new file /etc/profile.d/maven.sh. and add following content. Now load the environment variables in current shell using following command.

Step 4 – Verify Installation

You have successfully installed and configured Apache Maven on your Ubuntu system. Use the following command to check the version of Maven. Finally, remove the downloaded archive file from local. To read more about Apache Maven visit here.