public class GitCommitIdMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
static String |
BRANCH |
static String |
BRANCH_CLASSIFIER |
static String |
BUILD_AUTHOR_EMAIL |
static String |
BUILD_AUTHOR_NAME |
static String |
BUILD_TIME |
static String |
COMMIT_AUTHOR_EMAIL |
static String |
COMMIT_AUTHOR_NAME |
static String |
COMMIT_DESCRIBE |
static String |
COMMIT_ID |
static String |
COMMIT_ID_ABBREV |
static String |
COMMIT_MESSAGE_FULL |
static String |
COMMIT_MESSAGE_SHORT |
static String |
COMMIT_TIME |
static String |
REMOTE_ORIGIN_URL |
| Constructor and Description |
|---|
GitCommitIdMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
determineBranchName(org.eclipse.jgit.lib.Repository git,
Map<String,String> env)
If running within Jenkins/Hudosn, honor the branch name passed via GIT_BRANCH env var.
|
protected String |
determineBranchNameOnBuildServer(org.eclipse.jgit.lib.Repository git,
Map<String,String> env)
Is "Jenkins aware", and prefers
GIT_BRANCH to getting the branch via git if that enviroment variable is set. |
void |
execute() |
Properties |
getProperties() |
void |
setAbbrevLength(int abbrevLength) |
void |
setDateFormat(String dateFormat) |
void |
setDotGitDirectory(File dotGitDirectory) |
void |
setExcludeProperties(List<String> excludeProperties) |
void |
setFormat(String format) |
void |
setGitDescribe(GitDescribeConfig gitDescribe) |
void |
setPrefix(String prefix) |
void |
setVerbose(boolean verbose) |
protected String |
toBranchClassifier(String branch) |
public static final String BRANCH
public static final String BRANCH_CLASSIFIER
public static final String COMMIT_ID
public static final String COMMIT_ID_ABBREV
public static final String COMMIT_DESCRIBE
public static final String BUILD_AUTHOR_NAME
public static final String BUILD_AUTHOR_EMAIL
public static final String BUILD_TIME
public static final String COMMIT_AUTHOR_NAME
public static final String COMMIT_AUTHOR_EMAIL
public static final String COMMIT_MESSAGE_FULL
public static final String COMMIT_MESSAGE_SHORT
public static final String COMMIT_TIME
public static final String REMOTE_ORIGIN_URL
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected String determineBranchName(org.eclipse.jgit.lib.Repository git, Map<String,String> env) throws IOException
git - env - IOExceptionprotected String determineBranchNameOnBuildServer(org.eclipse.jgit.lib.Repository git, Map<String,String> env) throws IOException
GIT_BRANCH to getting the branch via git if that enviroment variable is set.
The variable is set by Jenkins/Hudson when put in detached HEAD state, but it still knows which branch was cloned.IOExceptionpublic void setFormat(String format)
public void setVerbose(boolean verbose)
public void setDotGitDirectory(File dotGitDirectory)
public void setPrefix(String prefix)
public void setDateFormat(String dateFormat)
public Properties getProperties()
public void setGitDescribe(GitDescribeConfig gitDescribe)
public void setAbbrevLength(int abbrevLength)
Copyright © 2014. All Rights Reserved.