Advertisement
Mark2020H

bash Script to install maven on open Suse Leap ver 15.1

Feb 6th, 2020
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.92 KB | None | 0 0
  1. #!/usr/bin/sh
  2.  
  3. ## Dont forget to chmod the script  using  chmod +x <name  you saved this as>.sh   or what ever you saved this as with
  4. ## extension sh
  5. ## executing script is done like this ./<name  you saved this as>.sh
  6.  
  7. clear
  8. echo "Script to install Maven on opens SUSE Linux Leap version 15.1 MD Harrington 2 Feb 2020 please wait "
  9. echo
  10. sleep 2s
  11. echo "Please note !! Maven is not included in thier open source repositories "
  12. echo
  13. echo "Do not under any circumstances use the openSUSE  one click install  you will wind up with broken packages  !!  Yes it is that good !! "
  14.  
  15. sleep 8s
  16. clear
  17. echo ,"Now starting to install please wait until you  are prompted with done ! "
  18.  
  19. clear
  20. echo "Tarball for Maven is now about to be  downloaded from Apache "
  21.  
  22. wget http://ftp.byfly.by/pub/apache.org/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
  23.  
  24. sleep 5s
  25.  
  26. clear
  27.  
  28. echo "Unzipping tarball to /opt"
  29.  
  30. sudo tar -xvzf apache-maven-3.3.9-bin.tar.gz -C /opt
  31.  
  32. sleep 5s
  33.  
  34. clear
  35.  
  36. echo "Renaming file apache-maven-3.3.9 to Maven"
  37.  
  38. sudo mv /opt/apache-maven-3.3.9 /opt/maven
  39. sleep 3s
  40. clear
  41.  
  42. echo "Altering .bashrc  to refelct path of maven   "
  43.  
  44. ## warning do not alter these next 4 four lines below or you will  overwrite bashrc ##
  45.  
  46. echo '# =======  maven settings =========' >> ~/.bashrc
  47. echo 'export M2_HOME=/opt/maven/' >>  ~/.bashrc  
  48. echo 'export M2=$M2_HOME/bin'>> ~/.bashrc
  49. echo 'export PATH=$M2:$PATH' >> ~/.bashrc
  50.  
  51. echo "Finished  editing ~/.bashrc  "
  52. sleep 5s
  53. clear
  54.  
  55. echo "Check and display contents of bashrc file to ensure path was  appended to end of file"
  56. echo
  57.  
  58. cat ~/.bashrc
  59.  
  60. sleep 2s
  61. clear
  62.  
  63. echo "If you can see the Maven version  showing  on your screen   and possibly java version then it all worked "
  64.  
  65. source ~/.bashrc
  66.  
  67. mvn -v
  68. sleep 5s
  69. clear
  70.  
  71. echo " DONE !! Exiting script  Cheers  hopefully that should sort next issue out MD Harrington "
  72.  
  73. exit -1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement