Class GitDirLocator


  • public class GitDirLocator
    extends java.lang.Object
    This class encapsulates logic to locate a valid .git directory of the currently used project. If it's not already specified, this logic will try to find it.
    • Constructor Summary

      Constructors 
      Constructor Description
      GitDirLocator​(org.apache.maven.project.MavenProject mavenProject, java.util.List<org.apache.maven.project.MavenProject> reactorProjects)
      Constructor to encapsulates all references required to locate a valid .git directory
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File lookupGitDirectory​(java.io.File manuallyConfiguredDir)
      Attempts to lookup a valid .git directory of the currently used project.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GitDirLocator

        public GitDirLocator​(org.apache.maven.project.MavenProject mavenProject,
                             java.util.List<org.apache.maven.project.MavenProject> reactorProjects)
        Constructor to encapsulates all references required to locate a valid .git directory
        Parameters:
        mavenProject - The currently used (maven) project.
        reactorProjects - The list of reactor projects (sub-projects) of the current (maven) project.
    • Method Detail

      • lookupGitDirectory

        @Nullable
        public java.io.File lookupGitDirectory​(@Nonnull
                                               java.io.File manuallyConfiguredDir)
        Attempts to lookup a valid .git directory of the currently used project.
        Parameters:
        manuallyConfiguredDir - A user has the ability to configure a git-directory with the dotGitDirectory configuration setting. By default it should be simply ${project.basedir}/.git
        Returns:
        A valid .git directory, or null if none could be found under the user specified location or within the project or it's reactor projects.