-
-
Save lwiechec/3450531 to your computer and use it in GitHub Desktop.
nexus commandline search
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
#!/bin/bash | |
# command line search script for nexus instances. Needs curl and xmlstarlet | |
# installed. | |
NEXUS_URL="http://nexus.example.com/nexus/service/local/lucene/search?q=" | |
# make sure we got exactly one param | |
if [ ! $# -eq 1 ] | |
then | |
echo "usage nexus-search <term>" | |
exit 1 | |
fi | |
curl -s $NEXUS_URL$1 | xmlstarlet sel -T -t -m /searchNGResponse/data/artifact \ | |
-v "groupId" -o " "\ | |
-v "artifactId" -o " " \ | |
-v "version" -n |
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
#!/usr/bin/awk -f | |
# simple AWK script to be used with nexus-search script to convert the results | |
# into maven-compatible dependency statements | |
{ printf("<dependency>\n <groupId>%s</groupId>\n <artefactId>%s</artefactId>\n <version>%s</version>\n</dependency>\n\n", $1, $2, $3) } |
I think that it does not work with Nexus v3.x
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
usage: nexus-search | maven-deps.awk