Class CommitMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
-
- com.github.koraktor.mavanagaiata.mojo.CommitMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="commit", defaultPhase=INITIALIZE, threadSafe=true) public class CommitMojo extends AbstractGitMojoThis goal provides the full ID of the current Git commit in the "mavanagaiata.commit.id", "mavanagaiata.commit.sha", "mvngit.commit.id", "mvngit.commit.sha" properties. The abbreviated commit ID is stored in the "mavanagaiata.commit.abbrev" and "mvngit.commit.abbrev" properties. Additionally the author's and committer's name and email address are stored in the properties "mavanagaiata.commit.author.name", "mavanagaiata.commit.author.email", "mvngit.commit.author.name" and "mvngit.commit.author.email", and "mavanagaiata.commit.committer.name", "mavanagaiata.commit.committer.email", "mvngit.commit.committer.name" and "mvngit.commit.committer.email" respectively.- Since:
- 0.1.0
- Author:
- Sebastian Staudt
-
-
Field Summary
-
Fields inherited from class com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
baseDir, dateFormat, dirtyFlag, dirtyIgnoreUntracked, failGracefully, gitDir, head, project, propertyPrefixes, skip, skipNoGit
-
-
Constructor Summary
Constructors Constructor Description CommitMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun(GitRepository repository)The ID (full and abbreviated) of the current Git commit out Git branch is retrieved using a JGit Repository instance-
Methods inherited from class com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
addProperty, execute, init, initRepository, prepareParameters
-
-
-
-
Method Detail
-
run
public void run(GitRepository repository) throws MavanagaiataMojoException
The ID (full and abbreviated) of the current Git commit out Git branch is retrieved using a JGit Repository instance- Specified by:
runin classAbstractGitMojo- Parameters:
repository- The repository instance to use- Throws:
MavanagaiataMojoException- if retrieving information from the Git repository fails- See Also:
AnyObjectId.getName(),ObjectReader.abbreviate(org.eclipse.jgit.lib.AnyObjectId, int)
-
-