Installing Maven using Yum on EC2 instance (Amazon Linux)
Install Maven :
Following are the set of commands need to be executed sequentially to install maven.
- sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
- sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
- sudo yum install -y apache-maven
- mvn –version
And you all set to run any “mvn” (maven) command in ec2 instance.
[ec2-user@ip-123-45-67-89 sudhir]$ mvn –version
Output :
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T16:41:47+00:00)
Maven home: /usr/share/apache-maven
Java version: 1.7.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.9.43-17.39.amzn1.x86_64", arch: "amd64", family: "unix"