1"""Find value of a Maven pom attribute given a pom file. 2 3 Usage: 4 python find_pom_value.py <pom-file> <pom-attribute> 5""" 6import sys 7import xml.etree.ElementTree as Xml 8 9 10def main(argv): 11 pom_file = argv[1] 12 pom_attribute = argv[2] 13 print( 14 Xml.ElementTree(file=pom_file).findtext( 15 "{http://maven.apache.org/POM/4.0.0}%s" % pom_attribute)) 16 17 18if __name__ == "__main__": 19 main(sys.argv) 20