Created
October 18, 2017 08:39
-
-
Save balioune/f3612dd483eda424a50f84245212821b to your computer and use it in GitHub Desktop.
setup_odl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function install_packages { | |
#install java8 | |
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 -y | |
sudo apt-get update -y | |
sudo apt-get install oracle-java8-installer -y | |
sudo update-java-alternatives -s java-8-oracle | |
sudo apt-get install oracle-java8-set-default -y | |
#install maven | |
sudo mkdir -p /usr/local/apache-maven; cd /usr/local/apache-maven | |
curl https://www.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz | sudo tar -xzv | |
sudo update-alternatives --install /usr/bin/mvn mvn /usr/local/apache-maven/apache-maven-3.3.9/bin/mvn 1 | |
sudo update-alternatives --config mvn | |
cat << EOF > $HOME/maven.env | |
export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9 | |
export MAVEN_OPTS="-Xms256m -Xmx512m" # Very important to put the "m" on the end | |
export JAVA_HOME=/usr/lib/jvm/java-8-oracle # This matches sudo update-alternatives --config java | |
EOF | |
sudo apt-get install npm vim git git-review diffstat -y | |
} | |
function configure_maven { | |
source $HOME/maven.env | |
mkdir $HOME/.m2 | |
wget -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > $HOME/.m2/settings.xml | |
} | |
echo "Install packages" | |
install_packages | |
echo "Configure maven " | |
configure_maven |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment