First, update the yum packages
sudo yum update -y
then run the following command to add the Maven repository
sudo wget https://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
To set the version number run this command
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
Next, run this command to install Apache maven
sudo yum install -y apache-maven