A maven dependency tree parser to check for all the included dependencies in a maven project.

Usage Link to heading

  1. Build a dependency tree of a maven project with mvn dependency:tree -DoutputFile=<path-to-file>. See details on maven dependency plugin page http://maven.apache.org/plugins/maven-dependency-plugin/usage.html#dependency:tree
  2. Run script as
    python dependency_parser.py -f test.txt --dependency "<dependency_name>"
    

How the script works Link to heading

Since it is evident that mvn dependency:tree creates a dependency tree, the dependency_parser parses the file and creates a tree and finds all the ancestors.
An important part is dependency sanitization, to cleanup tokens like +- and -.
The +- token means the dependency has children and the - means the dependency is the leaf child of the tree.