How Do You Install Maven on Linux?

Problem scenario
How do you install Apache Maven on any distribution of Linux?

This is based on Apache Maven 3.6.3.*

curl > /tmp/apache-maven-$mavenversion-bin.tar.gz
#curl$mavenversion/binaries/apache-maven-$mavenversion-bin.tar.gz > /tmp/apache-maven-$mavenversion-bin.tar.gz
cd /tmp/
sudo tar -xzvf apache-maven-$mavenversion-bin.tar.gz
sudo mv apache-maven-$mavenversion /opt/maven
export M2_HOME=/opt/maven
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
source ~/.bashrc
mvn -v

*You can change the directions if you want. You can get the latest installation media from here:

Leave a comment

Your email address will not be published. Required fields are marked *