Install and Configure Apache Maven on Ubuntu 22.04 LTS | Setup Maven Environment Variables | Maven



In this Video we are going to cover Install and Configure Apache Maven on Ubuntu 22.04 LTS | Setup Maven Environment Variables | Maven Tutorial for DevOps
#maven #maventutorial #installmaven
0:00 Introduction to Maven
16:10 Install Maven on Ubuntu 22.04 LTS

Please below instructions to Install Apache Maven on Ubuntu 22.04 LTS

Downloading Latest Apache Maven on Ubuntu 20.04 LTS

cd /tmp

wget http://www-eu.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz

wget https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz

sudo tar xf /tmp/apache-maven-*.tar.gz -C /opt

sudo ln -s /opt/apache-maven-3.6.3 /opt/maven

Setting Maven Environment Variable

sudo nano /etc/profile.d/maven.sh

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export M2_HOME=/opt/maven
export MAVEN_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}

sudo chmod +x /etc/profile.d/maven.sh

source /etc/profile.d/maven.sh

mvn -version

Leave a Reply

Your email address will not be published.