Skip to content

Instantly share code, notes, and snippets.

@dcolish
Created February 9, 2013 19:31
Show Gist options
  • Save dcolish/4746700 to your computer and use it in GitHub Desktop.
Save dcolish/4746700 to your computer and use it in GitHub Desktop.
Always have the javadocs
#!/bin/bash
if [ $DEBUG ]; then
set -x
fi
set -e
unpackJar() {
echo $1
FILE=$(python -c "import sys,os.path; print (os.path.abspath(sys.argv[1]))" $1)
NO_EXT=$(python -c "import sys,os.path; print (os.path.splitext(sys.argv[1])[0])" $1)
DOC_DIR=target/javadoc/$(basename $NO_EXT)
mkdir -p $DOC_DIR
pushd $DOC_DIR
jar xvf $FILE
popd
}
export -f unpackJar
mvn dependency:copy-dependencies -Dclassifier=javadoc
find target/dependency -type f -name "*.jar" | xargs -I% bash -ic "unpackJar %"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment