Wednesday, 14 October 2015

Installing Maven on Centos 6.4 with Java 1.7

Wanted to build a virtual machine under Vagrant to build Java 1.7 applications that will be deployed on RH/Centos6.4. As root or use sudo:

  1. yum update - my centos6.4 box was out of date and yum couldn't handle https repos, the ca-certificates package needed updating.
  2. yum install epel-release - the EPEL repos will now work as they use https by default
  3. yum install java-1.7.0-openjdk-devel - yeah java!
  4. yum install wget - no it wasn't installed by default
  5. wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo - Maven is not available from standard RPM repo sigh
  6. yum install apache-maven - nope! it will fail as it requires java-devel >= 1.7.0 which for some reason java-1.7.0-openjdk-devel fails to provide, even though the 1.5 and 1.6 packages do! sigh
  7. yum install yum-utils - to get repoquery
  8. rpm -Uvh --nodeps `repoquery --location apache-maven` - install maven ignoring dependency

In Summary

yum update
yum install epel-release
yum install java-1.7.0-openjdk-devel
yum install wget
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
yum install yum-utils
rpm -Uvh --nodeps `repoquery --location apache-maven`

No comments:

Post a Comment