Class ReleaseUtil

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

public class ReleaseUtil extends Object
Author:
Emmanuel Venisse
  • Field Details

  • Method Details

    • getRootProject

      public static org.apache.maven.project.MavenProject getRootProject(List<org.apache.maven.project.MavenProject> 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.
    • readXmlFile

      public static String readXmlFile(File file, String ls) throws IOException
      Throws:
      IOException
    • 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<org.apache.maven.project.MavenProject> reactorProjects) throws ReleaseExecutionException
      Throws:
      ReleaseExecutionException
    • getBaseWorkingDirectoryParentCount

      public static int getBaseWorkingDirectoryParentCount(Path baseDirectory, Path workingDirectory)
    • realignScmUrl

      public static String realignScmUrl(int parentLevels, String url)
    • interpolate

      public static String interpolate(String value, org.apache.maven.model.Model model) throws ReleaseExecutionException
      Throws:
      ReleaseExecutionException