org.apache.maven.plugin.changes
Class ReleaseUtils

java.lang.Object
  extended by org.apache.maven.plugin.changes.ReleaseUtils

public class ReleaseUtils
extends Object

A utility class for working with Release objects.

Since:
2.4
Version:
$Id: ReleaseUtils.java 1586409 2014-04-10 18:48:13Z dennisl $
Author:
Dennis Lundberg

Constructor Summary
ReleaseUtils(Log log)
           
 
Method Summary
 List<Release> convertReleaseList(List changesReleases)
          Convert an untyped List of Release objects that comes from changes.xml into a typed List of Release objects.
 Release getLatestRelease(List<Release> releases, String pomVersion)
          Get the latest release by matching the supplied releases with the version from the pom.
protected  Release getRelease(List<Release> releases, String version)
          Get a release with the specified version from the list of releases.
protected  void logRelease(Release release)
           
 List<Release> mergeReleases(List<Release> firstReleases, List<Release> secondReleases)
          Merge releases from one issue tracker with releases from another issue tracker.
 List mergeReleases(List releases, String componentName, List componentReleases)
          Merge releases from parent component with releases from child component.
static String toString(List<Release> releases)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReleaseUtils

public ReleaseUtils(Log log)
Method Detail

getLatestRelease

public Release getLatestRelease(List<Release> releases,
                                String pomVersion)
                         throws 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:
MojoExecutionException - If a release can't be found

getRelease

protected 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 void logRelease(Release release)

mergeReleases

public 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

convertReleaseList

public List<Release> convertReleaseList(List changesReleases)
Convert an untyped List of Release objects that comes from changes.xml into a typed List of Release objects.

Parameters:
changesReleases - An untyped List of Release objects
Returns:
A type List of Release objects

mergeReleases

public List mergeReleases(List releases,
                          String componentName,
                          List 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)


Copyright © 2002–2014 The Apache Software Foundation. All rights reserved.