Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/sh
- ## Dont forget to chmod the script using chmod +x <name you saved this as>.sh or what ever you saved this as with
- ## extension sh
- ## executing script is done like this ./<name you saved this as>.sh
- clear
- echo "Script to install Maven on opens SUSE Linux Leap version 15.1 MD Harrington 2 Feb 2020 please wait "
- echo
- sleep 2s
- echo "Please note !! Maven is not included in thier open source repositories "
- echo
- echo "Do not under any circumstances use the openSUSE one click install you will wind up with broken packages !! Yes it is that good !! "
- sleep 8s
- clear
- echo ,"Now starting to install please wait until you are prompted with done ! "
- clear
- echo "Tarball for Maven is now about to be downloaded from Apache "
- wget http://ftp.byfly.by/pub/apache.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
- sleep 5s
- clear
- echo "Unzipping tarball to /opt"
- sudo tar -xvzf apache-maven-3.3.9-bin.tar.gz -C /opt
- sleep 5s
- clear
- echo "Renaming file apache-maven-3.3.9 to Maven"
- sudo mv /opt/apache-maven-3.3.9 /opt/maven
- sleep 3s
- clear
- echo "Altering .bashrc to refelct path of maven "
- ## warning do not alter these next 4 four lines below or you will overwrite bashrc ##
- echo '# ======= maven settings =========' >> ~/.bashrc
- echo 'export M2_HOME=/opt/maven/' >> ~/.bashrc
- echo 'export M2=$M2_HOME/bin'>> ~/.bashrc
- echo 'export PATH=$M2:$PATH' >> ~/.bashrc
- echo "Finished editing ~/.bashrc "
- sleep 5s
- clear
- echo "Check and display contents of bashrc file to ensure path was appended to end of file"
- echo
- cat ~/.bashrc
- sleep 2s
- clear
- echo "If you can see the Maven version showing on your screen and possibly java version then it all worked "
- source ~/.bashrc
- mvn -v
- sleep 5s
- clear
- echo " DONE !! Exiting script Cheers hopefully that should sort next issue out MD Harrington "
- exit -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement