Esempio n. 1
0
 def extensions(self):
     """
     List of extensions
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:build/pom:extensions/pom:extension")
     return [Extension.from_xml_element(x) for x in xmlnodes]
Esempio n. 2
0
    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)
Esempio n. 3
0
 def dependencies(self):
     """
     List of dependencies
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:dependencies/pom:dependency")
     return [Dependency.from_xml_element(x) for x in xmlnodes]
Esempio n. 4
0
 def plugins(self):
     """
     List of plugins
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:build/pom:plugins/pom:plugin")
     return [Plugin.from_xml_element(x) for x in xmlnodes]
Esempio n. 5
0
 def extensions(self):
     """
     List of extensions
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:build/pom:extensions/pom:extension")
     return [Extension.from_xml_element(x) for x in xmlnodes]
Esempio n. 6
0
 def plugins(self):
     """
     List of plugins
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:build/pom:plugins/pom:plugin")
     return [Plugin.from_xml_element(x) for x in xmlnodes]
Esempio n. 7
0
 def dependencies(self):
     """
     List of dependencies
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:dependencies/pom:dependency")
     return [Dependency.from_xml_element(x) for x in xmlnodes]
Esempio n. 8
0
 def pluginManagement(self):
     """
     List of plugins from plugin management section
     """
     xmlnodes = POMReader.xpath(
         self._doc, "./pom:pluginManagement"
         "/pom:plugins/pom:plugin")
     return [Plugin.from_xml_element(x) for x in xmlnodes]
Esempio n. 9
0
 def dependencyManagement(self):
     """
     List of dependencies from dependency management section
     """
     xmlnodes = POMReader.xpath(
         self._doc, "./pom:dependencyManagement"
         "/pom:dependencies/pom:dependency")
     return [Dependency.from_xml_element(x) for x in xmlnodes]
Esempio n. 10
0
 def pluginManagement(self):
     """
     List of plugins from plugin management section
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:pluginManagement"
                                "/pom:plugins/pom:plugin")
     return [Plugin.from_xml_element(x) for x in xmlnodes]
Esempio n. 11
0
 def dependencyManagement(self):
     """
     List of dependencies from dependency management section
     """
     xmlnodes = POMReader.xpath(self._doc,
                                "./pom:dependencyManagement"
                                "/pom:dependencies/pom:dependency")
     return [Dependency.from_xml_element(x) for x in xmlnodes]
Esempio n. 12
0
    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)