Last active
April 14, 2022 21:31
-
-
Save speedlog/af2b6e4c79ca1cba2b3c77d0e75ffd86 to your computer and use it in GitHub Desktop.
Script to install maven wrapper without having installed maven in system
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
wget https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper-distribution/3.1.0/maven-wrapper-distribution-3.1.0-bin.zip | |
unzip maven-wrapper-distribution-3.1.0-bin.zip | |
rm maven-wrapper-distribution-3.1.0-bin.zip | |
# get current version from maven repository | |
MAVEN_CURRENT_RELEASE=$(curl -s https://repo1.maven.org/maven2/org/apache/maven/apache-maven/maven-metadata.xml | grep -oPm1 "(?<=<release>)[^<]+") | |
# or uncomment below line to explicit version | |
#MAVEN_CURRENT_RELEASE=3.8.5 | |
echo "distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/$MAVEN_CURRENT_RELEASE/apache-maven-$MAVEN_CURRENT_RELEASE-bin.zip" >> .mvn/wrapper/maven-wrapper.properties | |
echo "wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" >> .mvn/wrapper/maven-wrapper.properties |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
curl https://gist.githubusercontent.com/speedlog/af2b6e4c79ca1cba2b3c77d0e75ffd86/raw/0356df74962dd57d0b23887636c6f87cde996234/install_maven_wrapper_without_maven.sh | bash