org.apache.maven.shared.release.util
Class ReleaseUtil

java.lang.Object
  extended by org.apache.maven.shared.release.util.ReleaseUtil

public class ReleaseUtil
extends Object

Version:
$Id: ReleaseUtil.java 903749 2010-01-27 17:32:53Z brett $
Author:
Emmanuel Venisse

Field Summary
static String LS
          The line separator to use.
static String POMv4
           
static String RELEASE_POMv4
           
 
Method Summary
static ReleaseDescriptor createBasedirAlignedReleaseDescriptor(ReleaseDescriptor releaseDescriptor, List reactorProjects)
           
static int getBaseWorkingDirectoryParentCount(String basedir, String workingDirectory)
           
static String getCommonBasedir(List reactorProjects)
           
static String getCommonBasedir(List reactorProjects, char separator)
           
static File getReleasePom(org.apache.maven.project.MavenProject project)
           
static org.apache.maven.project.MavenProject getRootProject(List reactorProjects)
           
static File getStandardPom(org.apache.maven.project.MavenProject project)
           
static String normalizeLineEndings(String text, String separator)
          Normalizes the line separators in the specified string.
static String readXmlFile(File file)
          Gets the string contents of the specified XML file.
static String realignScmUrl(int parentLevels, String url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELEASE_POMv4

public static final String RELEASE_POMv4
See Also:
Constant Field Values

POMv4

public static final String POMv4
See Also:
Constant Field Values

LS

public static final String LS
The line separator to use.

Method Detail

getRootProject

public static org.apache.maven.project.MavenProject getRootProject(List reactorProjects)

getStandardPom

public static File getStandardPom(org.apache.maven.project.MavenProject project)

getReleasePom

public static File getReleasePom(org.apache.maven.project.MavenProject project)

readXmlFile

public static String readXmlFile(File file)
                          throws IOException
Gets the string contents of the specified XML file. Note: In contrast to an XML processor, the line separators in the returned string will be normalized to use the platform's native line separator. This is basically to save another normalization step when writing the string contents back to an XML file.

Parameters:
file - The path to the XML file to read in, must not be null.
Returns:
The string contents of the XML file.
Throws:
IOException - If the file could not be opened/read.

normalizeLineEndings

public static String normalizeLineEndings(String text,
                                          String separator)
Normalizes the line separators in the specified string.

Parameters:
text - The string to normalize, may be null.
separator - The line separator to use for normalization, typically "\n" or "\r\n", must not be null.
Returns:
The input string with normalized line separators or null if the string was null .

createBasedirAlignedReleaseDescriptor

public static ReleaseDescriptor createBasedirAlignedReleaseDescriptor(ReleaseDescriptor releaseDescriptor,
                                                                      List reactorProjects)
                                                               throws ReleaseExecutionException
Throws:
ReleaseExecutionException

getCommonBasedir

public static String getCommonBasedir(List reactorProjects)

getCommonBasedir

public static String getCommonBasedir(List reactorProjects,
                                      char separator)

getBaseWorkingDirectoryParentCount

public static int getBaseWorkingDirectoryParentCount(String basedir,
                                                     String workingDirectory)

realignScmUrl

public static String realignScmUrl(int parentLevels,
                                   String url)


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.