def from_xml_element(cls, xmlnode): """ Create Plugin from xml.etree.ElementTree.Element as contained within pom.xml. """ parts = {'groupId': '', 'artifactId': '', 'version': ''} parts = POMReader.find_parts(xmlnode, parts) if not parts['artifactId']: raise ArtifactFormatException( "Empty artifactId encountered. " "This is a bug, please report it!") # dependencies depnodes = POMReader.xpath(xmlnode, "./dependencies/dependency") deps = [] for d in [Dependency.from_xml_element(x) for x in depnodes]: deps.append(d) return cls(parts['groupId'], parts['artifactId'], parts['version'], deps)
def from_xml_element(cls, xmlnode): """ Create Extension from xml.etree.ElementTree.Element as contained within pom.xml. """ parts = {'groupId': '', 'artifactId': '', 'version': ''} parts = POMReader.find_parts(xmlnode, parts) if not parts['groupId'] or not parts['artifactId']: raise ArtifactFormatException( "Empty groupId or artifactId encountered. " "This is a bug, please report it!") return cls(parts['groupId'], parts['artifactId'], parts['version'])
def from_xml_element(cls, xmlnode): """ Create Plugin from xml.etree.ElementTree.Element as contained within pom.xml. """ parts = {'groupId': '', 'artifactId': '', 'version': ''} parts = POMReader.find_parts(xmlnode, parts) if not parts['artifactId']: raise ArtifactFormatException("Empty artifactId encountered. " "This is a bug, please report it!") # dependencies depnodes = POMReader.xpath(xmlnode, "./dependencies/dependency") deps = [] for d in [Dependency.from_xml_element(x) for x in depnodes]: deps.append(d) return cls(parts['groupId'], parts['artifactId'], parts['version'], deps)