Start by running CentOS updates
Yum update
Y
'.Install required packages Maven 3.3+ require JDK 1.7 or above to execute. At the time of writing, Maven 3.6.3 is the latest version.
Yum install java-11-openjdk-devel
Y
'.java -version
Install Maven Now we are ready to install Maven.
wget https://mirror.novg.net/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
/opt
with: tar xf apache-maven-3.6.3-bin.tar.gz -C /opt
ln -s /opt/apache-maven-3.6.3 /opt/maven
Configuration Configuration of Maven
maven.sh
into /etc/profile.d/
with: nano /etc/profile.d/maven.sh
export JAVA_HOME=/usr/lib/jvm/jre-openjdk
export M2_HOME=/opt/maven
export MAVEN_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}
chmod +x /etc/profile.d/maven.sh
source /etc/profile.d/maven.sh
To check if Maven is installed correctly use the following command: mvn -version
Maven is now installed onto your VPS.
comments (0)