Class JGitCheckInCommand
java.lang.Object
org.apache.maven.scm.command.AbstractCommand
org.apache.maven.scm.command.checkin.AbstractCheckInCommand
org.apache.maven.scm.provider.git.jgit.command.checkin.JGitCheckInCommand
- All Implemented Interfaces:
Command, GitCommand, CustomizableSshSessionFactoryCommand
public class JGitCheckInCommand
extends AbstractCheckInCommand
implements GitCommand, CustomizableSshSessionFactoryCommand
This provider uses the following strategy to discover the committer and author name/mail for a commit:
the default email domain to be used (will be used to create an email from the username passed to maven):
you can also enforce the usage of the username for the author and committer:
- "user" section in .gitconfig
- "username" passed to maven execution
- default git config (system user and hostname for email)
the default email domain to be used (will be used to create an email from the username passed to maven):
git config --global maven-scm.maildomain mycomp.com you can also enforce the usage of the username for the author and committer:
git config --global maven-scm.forceUsername true - Since:
- 1.9
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprivate BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> Fields inherited from class AbstractCheckInCommand
NAMEFields inherited from class AbstractCommand
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CheckInScmResultexecuteCheckInCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version) executeCommand(ScmProviderRepository repo, ScmFileSet fileSet, CommandParameters parameters) private JGitCheckInCommand.UserInfogetAuthor(ScmProviderRepository repo, org.eclipse.jgit.api.Git git) private JGitCheckInCommand.UserInfogetCommitter(ScmProviderRepository repo, org.eclipse.jgit.api.Git git) private StringvoidsetSshSessionFactorySupplier(BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> sshSessionFactorySupplier) Sets a different supplier for the SSH session factory that will be used by this command.Methods inherited from class AbstractCheckInCommand
executeCheckInCommandMethods inherited from class AbstractCommand
execute
-
Field Details
-
GIT_MAVEN_SECTION
- See Also:
-
GIT_MAILDOMAIN
- See Also:
-
GIT_FORCE
- See Also:
-
sshSessionFactorySupplier
private BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> sshSessionFactorySupplier
-
-
Constructor Details
-
JGitCheckInCommand
public JGitCheckInCommand()
-
-
Method Details
-
setSshSessionFactorySupplier
public void setSshSessionFactorySupplier(BiFunction<GitScmProviderRepository, org.slf4j.Logger, ScmProviderAwareSshdSessionFactory> sshSessionFactorySupplier) Description copied from interface:CustomizableSshSessionFactoryCommandSets a different supplier for the SSH session factory that will be used by this command. By default it usesScmProviderAwareSshdSessionFactory.- Specified by:
setSshSessionFactorySupplierin interfaceCustomizableSshSessionFactoryCommand- Parameters:
sshSessionFactorySupplier- a function that takes a GitScmProviderRepository and Logger and returns a ScmProviderAwareSshdSessionFactory
-
executeCommand
public CheckInScmResult executeCommand(ScmProviderRepository repo, ScmFileSet fileSet, CommandParameters parameters) throws ScmException - Overrides:
executeCommandin classAbstractCheckInCommand- Throws:
ScmException
-
executeCheckInCommand
protected CheckInScmResult executeCheckInCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message, ScmVersion version) throws ScmException - Specified by:
executeCheckInCommandin classAbstractCheckInCommand- Parameters:
repo-fileSet-message-version-- Returns:
- Throws:
ScmException
-
getCommitter
private JGitCheckInCommand.UserInfo getCommitter(ScmProviderRepository repo, org.eclipse.jgit.api.Git git) -
getAuthor
private JGitCheckInCommand.UserInfo getAuthor(ScmProviderRepository repo, org.eclipse.jgit.api.Git git) -
getHostname
-