Skip to content

Instantly share code, notes, and snippets.

@bdelacretaz
Last active May 5, 2020 09:15
Show Gist options
  • Save bdelacretaz/b1a9f13d6ebe60348076ffe1b2e6cebc to your computer and use it in GitHub Desktop.
Save bdelacretaz/b1a9f13d6ebe60348076ffe1b2e6cebc to your computer and use it in GitHub Desktop.
#!/bin/bash
# List all versions of Sling modules from a Maven repository
# ..just a ugly hack, we should use more solid parsing, or the Maven repository API
#
BASE_URL="https://repo1.maven.org/maven2/org/apache/sling/"
EGREP_FILTER=
curl -s $BASE_URL | grep 'a href' | egrep -v '\.\./|maven-metadata' | cut -d'"' -f2 | while read mod
do
curl -s ${BASE_URL}${mod} | grep 'a href' | egrep -v '\.\./|maven-metadata' | while read line
do
V=$(echo $line | cut -d'"' -f2)
D=$(echo $line | sed 's/.*a>//' | sed 's/^ *//' | cut -d' ' -f1)
echo "$mod $V $D"
done | sort
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment