Package pl.project13.maven.git
Class GitDirLocator
- java.lang.Object
-
- pl.project13.maven.git.GitDirLocator
-
public class GitDirLocator extends java.lang.ObjectThis 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.FilelookupGitDirectory(java.io.File manuallyConfiguredDir)Attempts to lookup a valid .git directory of the currently used project.
-
-
-
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 thedotGitDirectoryconfiguration setting. By default it should be simply${project.basedir}/.git- Returns:
- A valid .git directory, or
nullif none could be found under the user specified location or within the project or it's reactor projects.
-
-