Skip to content

Instantly share code, notes, and snippets.

@ericfialkowski
Last active May 31, 2016 03:28
Show Gist options
  • Save ericfialkowski/f663852c9464776cba60b640a32c5576 to your computer and use it in GitHub Desktop.
Save ericfialkowski/f663852c9464776cba60b640a32c5576 to your computer and use it in GitHub Desktop.
Installs latest jdk8 & mvn
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.host_name = "jdk8"
#config.vm.network "forwarded_port", guest: 1111, host: 1111
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.56.200"
$jdk_install = <<SCRIPT
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get -q -y update
sudo apt-get -q -y install oracle-java8-installer htop oracle-java8-set-default
SCRIPT
$mvn_install = <<SCRIPT
wget http://apache.cs.utah.edu/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar -zxf apache-maven-3.3.9-bin.tar.gz
sudo cp -R apache-maven-3.3.9 /usr/local
rm apache-maven-3.3.9-bin.tar.gz
sudo ln -s /usr/local/apache-maven-3.3.9/bin/mvn /usr/bin/mvn
echo "export M2_HOME=/usr/local/apache-maven-3.3.9" | sudo tee -a /etc/profile
SCRIPT
config.vm.provision "shell", inline: $jdk_install
config.vm.provision "shell", inline: $mvn_install
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment