Class POM

    • Method Detail

      • getParentGroupId

        public String getParentGroupId()
        Gets the POM's parent groupId.
      • getParentArtifactId

        public String getParentArtifactId()
        Gets the POM's parent artifactId.
      • getParentVersion

        public String getParentVersion()
        Gets the POM's parent artifactId.
      • getGroupId

        public String getGroupId()
        Gets the POM's groupId.
      • getArtifactId

        public String getArtifactId()
        Gets the POM's artifactId.
      • getProjectName

        public String getProjectName()
        Gets the project name.
      • getProjectDescription

        public String getProjectDescription()
        Gets the project description.
      • getProjectURL

        public String getProjectURL()
        Gets the project URL.
      • getProjectInceptionYear

        public String getProjectInceptionYear()
        Gets the project inception year.
      • getOrganizationName

        public String getOrganizationName()
        Gets the organization name.
      • getOrganizationURL

        public String getOrganizationURL()
        Gets the organization URL.
      • getSCMConnection

        public String getSCMConnection()
        Gets the SCM connection string.
      • getSCMDeveloperConnection

        public String getSCMDeveloperConnection()
        Gets the SCM developerConnection string.
      • getSCMTag

        public String getSCMTag()
        Gets the SCM tag.
      • getSCMURL

        public String getSCMURL()
        Gets the SCM URL.
      • getIssueManagementSystem

        public String getIssueManagementSystem()
        Gets the issue management system.
      • getIssueManagementURL

        public String getIssueManagementURL()
        Gets the issue management URL.
      • getCIManagementSystem

        public String getCIManagementSystem()
        Gets the CI management system.
      • getCIManagementURL

        public String getCIManagementURL()
        Gets the CI management URL.
      • getPOM

        public static POM getPOM​(Class<?> c)
        Gets the Maven POM associated with the given class.
        Parameters:
        c - The class to use as a base when searching for a pom.xml.
        Returns:
        POM object representing the discovered POM, or null if no POM could be found.
      • getPOM

        public static POM getPOM​(Class<?> c,
                                 String groupId,
                                 String artifactId)
        Gets the Maven POM associated with the given class.
        Parameters:
        c - The class to use as a base when searching for a pom.xml.
        groupId - The Maven groupId of the desired POM.
        artifactId - The Maven artifactId of the desired POM.
        Returns:
        POM object representing the discovered POM, or null if no POM could be found.
      • getAllPOMs

        public static List<POM> getAllPOMs()
        Gets all available Maven POMs on the class path.
      • compareVersions

        public static int compareVersions​(String v1,
                                          String v2)
        Compares two version strings.

        Given the variation between versioning styles, there is no single comparison method that can possibly be correct 100% of the time. So this method works on a "best effort" basis; YMMV.

        The algorithm is as follows:

        • Split on non-alphameric characters.
        • Compare each token one by one.
        • Comparison is numerical when possible (i.e., when an integer can be parsed from the token), and lexicographic otherwise.
        • If one version string runs out of tokens, the version with additional tokens remaining is considered greater than the version without additional tokens.
        • There is one exception: if two version strings are identical except that one has a suffix beginning with a dash (-), the version with suffix will be considered less than the one without a suffix. The reason for this is to accommodate the SemVer versioning scheme's usage of "prerelease" version suffixes. For example, 2.0.0 will compare greater than 2.0.0-beta-1, whereas 2.0.0 will compare less than 2.0.0.1.
        Returns:
        a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
        See Also:
        Comparator.compare(Object, Object)