Skip to content

Instantly share code, notes, and snippets.

@Ranjith-Suranga
Last active September 10, 2023 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ranjith-Suranga/b879b0a762b0d8ae0d614e48ad4a6021 to your computer and use it in GitHub Desktop.
Save Ranjith-Suranga/b879b0a762b0d8ae0d614e48ad4a6021 to your computer and use it in GitHub Desktop.
Download the Latest Spring Framework
# D M R Suranga <suranga@ijse.lk> (https://ijse.lk)
# Download the file
# Open the terminal and set the execute permission to the file (chmod 766 download-latest-spring-framework.sh)
# Execute the file (./download-latest-spring-framework.sh)
#! /usr/bin/bash
wget -O maven-metadata.xml https://repo1.maven.org/maven2/org/springframework/spring-framework-bom/maven-metadata.xml
VERSION=$(cat maven-metadata.xml | grep "latest" | awk -F'[<>]' '/<latest>/{print $3}')
rm maven-metadata.xml
mkdir spring-framework-$VERSION
wget -O spring-framework-$VERSION/spring-framework-bom-$VERSION.pom https://repo1.maven.org/maven2/org/springframework/spring-framework-bom/$VERSION/spring-framework-bom-$VERSION.pom
DEPS=$(grep -oP '<artifactId>\K[^<]+' spring-framework-$VERSION/spring-framework-bom-$VERSION.pom | tail -n +2)
for DEP in $DEPS; do
wget -P spring-framework-$VERSION https://repo1.maven.org/maven2/org/springframework/$DEP/$VERSION/$DEP-$VERSION.jar
echo $DEP '- Downloaded'
done
# zip spring-framework-$VERSION.zip spring-framework-$VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment