Class POM

    • Method Detail

      • parentGroupId

        public String parentGroupId()
        Gets the POM's parent groupId.
      • parentArtifactId

        public String parentArtifactId()
        Gets the POM's parent artifactId.
      • parentVersion

        public String parentVersion()
        Gets the POM's parent artifactId.
      • groupId

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

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

        public String projectName()
        Gets the project name.
      • projectDescription

        public String projectDescription()
        Gets the project description.
      • projectURL

        public String projectURL()
        Gets the project URL.
      • projectInceptionYear

        public String projectInceptionYear()
        Gets the project inception year.
      • organizationName

        public String organizationName()
        Gets the organization name.
      • organizationURL

        public String organizationURL()
        Gets the organization URL.
      • scmConnection

        public String scmConnection()
        Gets the SCM connection string.
      • scmDeveloperConnection

        public String scmDeveloperConnection()
        Gets the SCM developerConnection string.
      • scmTag

        public String scmTag()
        Gets the SCM tag.
      • scmURL

        public String scmURL()
        Gets the SCM URL.
      • issueManagementSystem

        public String issueManagementSystem()
        Gets the issue management system.
      • issueManagementURL

        public String issueManagementURL()
        Gets the issue management URL.
      • ciManagementSystem

        public String ciManagementSystem()
        Gets the CI management system.
      • ciManagementURL

        public String ciManagementURL()
        Gets the CI management URL.
      • pom

        public static POM pom​(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.
      • pom

        public static POM pom​(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.
      • allPOMs

        public static List<POM> allPOMs()
        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 "pre-release" 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)