Class ReleaseUtil
- java.lang.Object
-
- org.apache.maven.shared.release.util.ReleaseUtil
-
public class ReleaseUtil extends java.lang.Object- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLSThe line separator to use.static java.lang.StringPOMv4static java.lang.StringRELEASE_POMv4
-
Constructor Summary
Constructors Modifier Constructor Description privateReleaseUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReleaseDescriptorcreateBasedirAlignedReleaseDescriptor(ReleaseDescriptor releaseDescriptor, java.util.List<org.apache.maven.project.MavenProject> reactorProjects)static intgetBaseWorkingDirectoryParentCount(java.nio.file.Path baseDirectory, java.nio.file.Path workingDirectory)static java.io.FilegetReleasePom(org.apache.maven.project.MavenProject project)static org.apache.maven.project.MavenProjectgetRootProject(java.util.List<org.apache.maven.project.MavenProject> reactorProjects)static java.io.FilegetStandardPom(org.apache.maven.project.MavenProject project)static java.lang.Stringinterpolate(java.lang.String value, org.apache.maven.model.Model model)static java.lang.StringnormalizeLineEndings(java.lang.String text, java.lang.String separator)Normalizes the line separators in the specified string.static java.lang.StringreadXmlFile(java.io.File file)Gets the string contents of the specified XML file.static java.lang.StringreadXmlFile(java.io.File file, java.lang.String ls)static java.lang.StringrealignScmUrl(int parentLevels, java.lang.String url)
-
-
-
Field Detail
-
RELEASE_POMv4
public static final java.lang.String RELEASE_POMv4
- See Also:
- Constant Field Values
-
POMv4
public static final java.lang.String POMv4
- See Also:
- Constant Field Values
-
LS
public static final java.lang.String LS
The line separator to use.
-
-
Method Detail
-
getRootProject
public static org.apache.maven.project.MavenProject getRootProject(java.util.List<org.apache.maven.project.MavenProject> reactorProjects)
-
getStandardPom
public static java.io.File getStandardPom(org.apache.maven.project.MavenProject project)
-
getReleasePom
public static java.io.File getReleasePom(org.apache.maven.project.MavenProject project)
-
readXmlFile
public static java.lang.String readXmlFile(java.io.File file) throws java.io.IOExceptionGets 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 benull.- Returns:
- The string contents of the XML file.
- Throws:
java.io.IOException- If the file could not be opened/read.
-
readXmlFile
public static java.lang.String readXmlFile(java.io.File file, java.lang.String ls) throws java.io.IOException- Throws:
java.io.IOException
-
normalizeLineEndings
public static java.lang.String normalizeLineEndings(java.lang.String text, java.lang.String separator)Normalizes the line separators in the specified string.- Parameters:
text- The string to normalize, may benull.separator- The line separator to use for normalization, typically "\n" or "\r\n", must not benull.- Returns:
- The input string with normalized line separators or
nullif the string wasnull.
-
createBasedirAlignedReleaseDescriptor
public static ReleaseDescriptor createBasedirAlignedReleaseDescriptor(ReleaseDescriptor releaseDescriptor, java.util.List<org.apache.maven.project.MavenProject> reactorProjects) throws ReleaseExecutionException
- Throws:
ReleaseExecutionException
-
getBaseWorkingDirectoryParentCount
public static int getBaseWorkingDirectoryParentCount(java.nio.file.Path baseDirectory, java.nio.file.Path workingDirectory)
-
realignScmUrl
public static java.lang.String realignScmUrl(int parentLevels, java.lang.String url)
-
interpolate
public static java.lang.String interpolate(java.lang.String value, org.apache.maven.model.Model model) throws ReleaseExecutionException- Throws:
ReleaseExecutionException
-
-