Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
Created January 20, 2009 15:15
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 matthewmccullough/49513 to your computer and use it in GitHub Desktop.
Save matthewmccullough/49513 to your computer and use it in GitHub Desktop.
Look for JARs that contain a given artifact name (Class, Resource, etc.)
#!/bin/sh
#Example Usage: findjars com/ambientideas/groovy
CLASSNAMETOFIND="$1"
for eachjar in `find . -iname "*.jar"`
do
echo "Searching in $eachjar ..."
jar tvf $eachjar | grep $CLASSNAMETOFIND > /dev/null
if [ $? == 0 ]
then
echo "******* Located \"$CLASSNAMETOFIND\" in $eachjar *******"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment