You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
409 B

"""Find value of a Maven pom attribute given a pom file.
Usage:
python find_pom_value.py <pom-file> <pom-attribute>
"""
import sys
import xml.etree.ElementTree as Xml
def main(argv):
pom_file = argv[1]
pom_attribute = argv[2]
print(
Xml.ElementTree(file=pom_file).findtext(
"{http://maven.apache.org/POM/4.0.0}%s" % pom_attribute))
if __name__ == "__main__":
main(sys.argv)