Class ReleaseUtils

java.lang.Object
org.apache.maven.plugins.changes.ReleaseUtils

public class ReleaseUtils extends Object
A utility class for working with Release objects.
Since:
2.4
Version:
$Id$
Author:
Dennis Lundberg
  • Method Details

    • getLatestRelease

      public static Release getLatestRelease(List<Release> releases, String pomVersion) throws org.apache.maven.plugin.MojoExecutionException
      Get the latest release by matching the supplied releases with the version from the pom.
      Parameters:
      releases - list of releases
      pomVersion - Version of the artifact
      Returns:
      A Release that matches the next release of the current project
      Throws:
      org.apache.maven.plugin.MojoExecutionException - If a release can't be found
    • getRelease

      protected static Release getRelease(List<Release> releases, String version)
      Get a release with the specified version from the list of releases.
      Parameters:
      releases - A list of releases
      version - The version we want
      Returns:
      A Release, or null if no release with the specified version can be found
    • logRelease

      protected static void logRelease(Release release)
    • mergeReleases

      public static List<Release> mergeReleases(List<Release> firstReleases, List<Release> secondReleases)
      Merge releases from one issue tracker with releases from another issue tracker. If a release is found in both issue trackers, i.e. they have the same version, their issues are merged into one release.
      Parameters:
      firstReleases - Releases from the first issue tracker
      secondReleases - Releases from the second issue tracker
      Returns:
      A list containing the merged releases
    • mergeReleases

      public static List<Release> mergeReleases(List<Release> releases, String componentName, List<Release> componentReleases)
      Merge releases from parent component with releases from child component. If a release is found in both components, i.e. they have the same version, their issues are merged into one (parent) release with component marker for component issues.
      Parameters:
      releases - Releases from the parent component
      componentName - child component name (retrieved from project name)
      componentReleases - Releases from the child component
      Returns:
      A list containing the merged releases
    • toString

      public static String toString(List<Release> releases)