Advertisement
Justman10000

Manage maven

Mar 2nd, 2023 (edited)
864
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.80 KB | None | 0 0
  1. // To install maven
  2. # Change $version to $alphaVersion to download the Alpha version of maven
  3. version=$(curl -s https://dlcdn.apache.org/maven/maven-3/ | grep -oP "\d+\.\d+\.\d+" | sort -rV | head -n 1)
  4. generation=3
  5. # alphaVersion=$(curl -s https://dlcdn.apache.org/maven/maven-4/ | grep -oP "\d+\.\d+\.\d+\-alpha-\d+" | sort -rV | head -n 1)
  6. # generation=4
  7.  
  8. wget https://dlcdn.apache.org/maven/maven-$generation/$version/binaries/apache-maven-$version-bin.zip
  9. unzip apache-maven-$version-bin.zip
  10. mv apache-maven-$version /usr/local/mvn
  11. ln -s /usr/local/mvn/bin/mvn /usr/bin
  12. ln -s /usr/local/mvn/bin/mvnyjp /usr/bin
  13. ln -s /usr/local/mvn/bin/mvnDebug /usr/bin
  14. rm -r apache-maven-$version-bin.zip
  15.  
  16. // To uninstall maven
  17. rm -r /usr/local/mvn
  18. rm -r /usr/bin/mvn
  19. rm -r /usr/bin/mvnyjp
  20. rm -r /usr/bin/mvnDebug
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement