Last active
March 10, 2017 01:38
-
-
Save parzonka/7978779 to your computer and use it in GitHub Desktop.
Install maven on linux
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 | |
# | |
# existing versions are not overwritten/deleted | |
# seamless upgrades/downgrades | |
# $M2_HOME points to latest *installed* (not released) | |
# config | |
mirror=http://mirror.cc.columbia.edu/pub | |
mvnversion=3.0.5 | |
# install | |
mvnidentifier="apache-maven-${mvnversion}" | |
wget -N "${mirror}/software/apache/maven/maven-3/${mvnversion}/binaries/${mvnidentifier}-bin.tar.gz" | |
sudo tar xzf ${mvnidentifier}-bin.tar.gz -C /opt/maven | |
sudo ln -sfn "/opt/${mvnidentifier}" /opt/maven/latest | |
sudo printf "export M2_HOME=/opt/maven/latest\nexport PATH=\$PATH:\$M2_HOME/bin" > /etc/profile.d/maven.sh | |
. /etc/profile.d/maven.sh | |
# check | |
mvn -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment