Skip to content

Instantly share code, notes, and snippets.

View redigaffi's full-sized avatar

Jordi Walter Hoock Castro redigaffi

View GitHub Profile
@redigaffi
redigaffi / gist:6948ab891fcc8c79506800f59c3312bb
Created September 10, 2019 09:20
Human readable list of Java dependencies
import xml.etree.ElementTree as ET
root = ET.parse('/home/jordi/IdeaProjects/backendapi/pom.xml').getroot()
dependencies = root.findall('*/{http://maven.apache.org/POM/4.0.0}dependency')
dependency_list = {}
for dependency in dependencies:
groupId = dependency.find('{http://maven.apache.org/POM/4.0.0}groupId').text
artifact = dependency.find('{http://maven.apache.org/POM/4.0.0}artifactId').text
try:
dependency_list[groupId].append(artifact)