Skip to content

Instantly share code, notes, and snippets.

@serban-petrescu
Created March 19, 2018 20:06
Show Gist options
  • Save serban-petrescu/7d80a36b8e450ee6716f6e05e58596e2 to your computer and use it in GitHub Desktop.
Save serban-petrescu/7d80a36b8e450ee6716f6e05e58596e2 to your computer and use it in GitHub Desktop.
Bash shell which builds a .csv file with all maven dependencies from a folder structure
for D in ` find . -maxdepth 2 -type f -name 'pom.xml' | sed -r 's|/[^/]+$||' | sort -u`
do
(cd $D && mvn -o dependency:tree |
grep -E ":.*:.*:(compile|test)" |
sed "s,\[INFO\] \(.\)[ |\\+-]*\([^:]*\):\([^:]*\):[^:]*:[^:]*:\([^:]*\),\1;\2;\3;\4,g" |
sed "s,[ |];,transitive;,g" |
sed "s,[+\\];,direct;,g")
done | sort -u | (echo "type;group;artefact;scope" && cat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment