Last active
August 7, 2018 12:06
-
-
Save ishchegl/318c76410ad4d8b33a935afcd57dff6e to your computer and use it in GitHub Desktop.
List all the JARs in local Maven repository containing specified class.
This file contains hidden or 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 | |
# List all the JARs in local Maven repository containing specified class. | |
# | |
# Usage: ./jarsearch.sh CLASSNAME | |
CLASSNAME="$1" | |
MAVEN_LOCAL_REPO="$HOME/.m2" | |
find "$MAVEN_LOCAL_REPO" -name "*.jar" | xargs -I{} bash -c "jar -tf {} | grep -q /${CLASSNAME}.class && echo {}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment