Exemple #1
0
 def groupId(self):
     """
     Effective groupId of the pom artifact taking into account parent groupId
     """
     gId = POMReader.find(self._doc, "./pom:groupId")
     if gId is None:
         gId = POMReader.find(self._doc, "./pom:parent/pom:groupId")
     if gId is None:
         raise PomLoadingException("Unable to determine groupId")
     return gId.text.strip()
Exemple #2
0
 def groupId(self):
     """
     Effective groupId of the pom artifact taking into account parent groupId
     """
     gId = POMReader.find(self._doc, "./pom:groupId")
     if gId is None:
         gId = POMReader.find(self._doc, "./pom:parent/pom:groupId")
     if gId is None:
         raise PomLoadingException("Unable to determine groupId")
     return gId.text.strip()
Exemple #3
0
 def version(self):
     """
     Effective version of the pom artifact taking into account parent
     version
     """
     version = POMReader.find(self._doc, "./pom:version")
     if version is None:
         version = POMReader.find(self._doc, "./pom:parent/pom:version")
     if version is None:
         raise PomLoadingException("Unable to determine artifact version")
     return version.text.strip()
Exemple #4
0
 def version(self):
     """
     Effective version of the pom artifact taking into account parent
     version
     """
     version = POMReader.find(self._doc, "./pom:version")
     if version is None:
         version = POMReader.find(self._doc, "./pom:parent/pom:version")
     if version is None:
         raise PomLoadingException("Unable to determine artifact version")
     return version.text.strip()
Exemple #5
0
 def version(self):
     version = POMReader.find(self.__doc, "/ivy-module/info")
     if version is not None:
         try:
             version = version.attrib["revision"]
         except KeyError:
             raise PomLoadingException("Unable to determine version")
     return version
Exemple #6
0
 def artifactId(self):
     aId = POMReader.find(self.__doc, "/ivy-module/info")
     if aId is not None:
         try:
             aId = aId.attrib["module"]
         except KeyError:
             raise PomLoadingException("Unable to determine artifactId")
     return aId
Exemple #7
0
 def version(self):
     version = POMReader.find(self.__doc, '/ivy-module/info')
     if version is not None:
         try:
             version = version.attrib["revision"]
         except KeyError:
             raise PomLoadingException("Unable to determine version")
     return version
Exemple #8
0
 def groupId(self):
     gId = POMReader.find(self.__doc, "/ivy-module/info")
     if gId is not None:
         try:
             gId = gId.attrib["organisation"]
         except:
             raise PomLoadingException("Unable to determine groupId")
     return gId
Exemple #9
0
 def groupId(self):
     gId = POMReader.find(self.__doc, '/ivy-module/info')
     if gId is not None:
         try:
             gId = gId.attrib["organisation"]
         except:
             raise PomLoadingException("Unable to determine groupId")
     return gId
Exemple #10
0
 def artifactId(self):
     aId = POMReader.find(self.__doc, '/ivy-module/info')
     if aId is not None:
         try:
             aId = aId.attrib["module"]
         except KeyError:
             raise PomLoadingException("Unable to determine artifactId")
     return aId
Exemple #11
0
 def artifactId(self):
     """
     Effective artifactId of the pom artifact
     """
     aId = POMReader.find(self._doc, "./pom:artifactId")
     if aId is None:
         raise PomLoadingException("Unable to determine artifactId")
     return aId.text.strip()
Exemple #12
0
 def artifactId(self):
     """
     Effective artifactId of the pom artifact
     """
     aId = POMReader.find(self._doc, "./pom:artifactId")
     if aId is None:
         raise PomLoadingException("Unable to determine artifactId")
     return aId.text.strip()
Exemple #13
0
 def packaging(self):
     """
     Packaging type of artifact or "jar" if unspecified
     """
     packaging = POMReader.find(self._doc, "./pom:packaging")
     if packaging is None:
         # use default packaging type
         return "jar"
     return packaging.text.strip()
Exemple #14
0
 def packaging(self):
     """
     Packaging type of artifact or "jar" if unspecified
     """
     packaging = POMReader.find(self._doc, "./pom:packaging")
     if packaging is None:
         # use default packaging type
         return "jar"
     return packaging.text.strip()
Exemple #15
0
    def parent(self):
        aId = POMReader.find(self._doc, "./pom:parent/pom:artifactId")
        if aId is None:
            return None
        artifactId = aId.text

        groupId = ""
        gId = POMReader.find(self._doc, "./pom:parent/pom:groupId")
        if gId is not None:
            groupId = gId.text

        version = ""
        ver = POMReader.find(self._doc, "./pom:parent/pom:version")
        if ver is not None:
            version = ver.text

        relativePath = ""
        relPath = POMReader.find(self._doc, "./pom:parent/pom:relativePath")
        if relPath is not None:
            relativePath = relPath.text

        return ParentPOM(groupId, artifactId, version, relativePath)
Exemple #16
0
    def parent(self):
        aId = POMReader.find(self._doc, "./pom:parent/pom:artifactId")
        if aId is None:
            return None
        artifactId = aId.text

        groupId = ""
        gId = POMReader.find(self._doc, "./pom:parent/pom:groupId")
        if gId is not None:
            groupId = gId.text

        version = ""
        ver = POMReader.find(self._doc, "./pom:parent/pom:version")
        if ver is not None:
            version = ver.text

        relativePath = ""
        relPath = POMReader.find(self._doc, "./pom:parent/pom:relativePath")
        if relPath is not None:
            relativePath = relPath.text

        return ParentPOM(groupId, artifactId, version, relativePath)
Exemple #17
0
    def properties(self):
        """
        Dictionary consisting of properties specified in pom.xml
        """
        properties = {}
        xmlnodes = POMReader.find(self._doc, "./pom:properties")
        if xmlnodes is None:
            return properties
        propnodes = xmlnodes.getchildren()
        for node in propnodes:
            if node.tag.startswith('{'):
                tag = node.tag[node.tag.find('}') + 1:]
            else:
                tag = node.tag
            properties[tag] = node.text

        return properties
Exemple #18
0
    def properties(self):
        """
        Dictionary consisting of properties specified in pom.xml
        """
        properties = {}
        xmlnodes = POMReader.find(self._doc, "./pom:properties")
        if xmlnodes is None:
            return properties
        propnodes = xmlnodes.getchildren()
        for node in propnodes:
            if node.tag.startswith('{'):
                tag = node.tag[node.tag.find('}') + 1:]
            else:
                tag = node.tag
            properties[tag] = node.text

        return properties
Exemple #19
0
 def has_parent(self):
     parent = POMReader.find(self._doc, "./pom:parent")
     if parent is not None:
         return True
     return False
Exemple #20
0
 def has_parent(self):
     parent = POMReader.find(self._doc, "./pom:parent")
     if parent is not None:
         return True
     return False