hakemon

pomDep.py

Dec 12th, 2015
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #!/bin/env python
  2. import xml.etree.ElementTree as ET
  3. tree = ET.parse('examplepom.xml')
  4. root = tree.getroot()
  5.  
  6. deps = root.findall(".//dependencies/dependency")
  7. for dep in deps:
  8.     artifactId = dep.find('artifactId').text
  9.     version = dep.find('version').text
  10.     print artifactId, version
Add Comment
Please, Sign In to add comment