Skip to content

Instantly share code, notes, and snippets.

@chenfanggm
Forked from skanjo/install-maven-centos.md
Created December 6, 2016 01:11
Show Gist options
  • Save chenfanggm/c087c043eb42e7c748dcc0b05253d6dc to your computer and use it in GitHub Desktop.
Save chenfanggm/c087c043eb42e7c748dcc0b05253d6dc to your computer and use it in GitHub Desktop.
Install Apache Maven on CentOS

For the latest download link check the Apache Maven download page:

https://maven.apache.org/download.cgi

Download Apache Maven

cd~
wget "http://mirror.sdunix.com/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz"

Create directory and install

sudo mkdir /usr/local/maven
sudo tar xzf apache-maven-3.3.9-bin.tar.gz -C /usr/local/maven
cd /usr/local
sudo ln -s apache-maven-3.3.9 latest
sudo ln -s latest default
cd /usr/local/bin
sudo ln -s /usr/local/maven/latest/bin/mvn mvn

Verify install

mvn -version

Allow all users in the enfironment to use the latest:

sudo sh -c "echo export M2_HOME=/usr/local/maven/latest >> /etc/environment"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment