Maven - Manual installation on Linux
This article explains the steps to manually install a specific version of maven downloaded directly from maven website or internal artficatory of an organisation.
Create a directory for installation:
mkdir -p $HOME/tools/maven
Download the binary:
From https://maven.apache.org/download.cgi download latest static binary eg: apache-maven-3.9.11-bin.tar.gz to $HOME/tools/maven directory
Extract the binary:
tar -xvzf $HOME/tools/maven/apache-maven-3.9.11-bin.tar.gz -C $HOME/tools/maven
Make files executable:
chmod a+rwx -R $HOME/tools/maven/*
Configure PATH:
Add the following lines to $HOME/.bash_profile or $HOME/.bashrc and restart system for the changes to take effect
nano $HOME/.bash_profile
export MAVEN_HOME=$HOME/tools/maven/apache-maven-3.9.11
export PATH=$MAVEN_HOME/bin:$PATH
Temporarily use source to load the changes without restart:
source $HOME/.bash_profile
Verify maven installation:
mvn -v
Comments
Post a Comment