Last active
October 22, 2018 15:47
-
-
Save mansurali901/bf33d4dc60bc4d0ef694c5d26a61159e to your computer and use it in GitHub Desktop.
Setup Apache Maven on Ubuntu 16.04 LTS
This file contains hidden or 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
# This script install Apache Maven 3.5.2 in Ubuntu 16.04 | |
# Author Mansur Ul Hasan | |
# [email protected] | |
CleanUp () { | |
# Removing Source Code | |
rm -f apache-maven-3.5.2-bin.tar.gz | |
} | |
Verify () { | |
mvn -version | |
# Calling Cleanup Method | |
CleanUp | |
} | |
SetupEnv () { | |
echo " | |
export M2_HOME=/usr/local/apache-maven | |
export MAVEN_HOME=/usr/local/apache-maven | |
export PATH=${M2_HOME}/bin:${PATH} | |
" >> ~/.bashrc | |
# Loading Environment | |
source ~/.bashrc | |
# Calling Verification Method | |
Verify | |
} | |
DownloadSource () { | |
# Downloading Source | |
cd /usr/local | |
wget http://www-eu.apache.org/dist/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip | |
tar -xzf apache-maven-3.5.2-bin.tar.gz | |
ln -s /usr/local/apache-maven-3.5.2 /usr/local/apache-maven | |
# Calling Environment Function | |
SetupEnv | |
} | |
DownloadSource |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment