Klasse AbstractGitMojo
- Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Bekannte direkte Unterklassen:
AbstractGitOutputMojo
,BranchMojo
,CheckMojo
,CommitMojo
,InfoClassMojo
,TagMojo
- Seit:
- 0.1.0
- Autor:
- Sebastian Staudt
- Siehe auch:
-
Feldübersicht
Modifizierer und TypFeldBeschreibung(Package privat) File
The working tree of the Git repository.protected String
The date format to use for various dates(Package privat) String
The flag to append to refs if there are changes in the index or working tree(Package privat) boolean
Specifies if the dirty flag should also be appended if there are untracked files(Package privat) boolean
Specifies if a failed execution of the mojo will stop the build process(Package privat) File
TheGIT_DIR
path of the Git repository(Package privat) String
The commit or ref to use as starting point for operationsprotected org.apache.maven.project.MavenProject
The Maven project(Package privat) String[]
The prefixes to prepend to property keys(Package privat) boolean
Skip the plugin execution(Package privat) boolean
Skip the plugin execution if not inside a Git repositoryVon Schnittstelle geerbte Felder org.apache.maven.plugin.Mojo
ROLE
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibung(Package privat) void
addProperty
(String name, String value) Saves a property with the given name into the project's properties The value will be stored two times – with "mavanagaiata" and "mvngit" as a prefix.final void
execute()
Generic execution sequence for a Mavanagaiata mojoprotected GitRepository
init()
Generic initialization for all Mavanagaiata mojos(Package privat) GitRepository
Initializes a JGit Repository object for further reference(Package privat) void
Prepares and validates user-supplied parametersprotected abstract void
run
(GitRepository repository) The actual implementation of the mojoVon Klasse geerbte Methoden org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Felddetails
-
dateFormat
@Parameter(property="mavanagaiata.dateFormat", defaultValue="MM/dd/yyyy hh:mm a Z") protected String dateFormatThe date format to use for various dates -
baseDir
The working tree of the Git repository.If there is only one project inside the Git repository this is probably
${project.basedir}
(default).Note: The
GIT_DIR
can be found automatically even if this is not the real working tree but one of its subdirectories. But Mavanagaiata cannot determine the state of the working tree (e.g. for the dirty flag) if this is not set correctly. -
dirtyFlag
The flag to append to refs if there are changes in the index or working treeSetting this to either
"false"
or"null"
will disable flagging refs as dirty.- Seit:
- 0.4.0
-
dirtyIgnoreUntracked
@Parameter(property="mavanagaiata.dirtyIgnoreUntracked", defaultValue="false") boolean dirtyIgnoreUntrackedSpecifies if the dirty flag should also be appended if there are untracked filesIf
false
only modified files that are already known to Git will cause the dirty flag to be appended.Warning: Do not enable this if builds should be reproducible.
- Seit:
- 0.5.0
-
failGracefully
@Parameter(property="mavanagaiata.failGracefully", defaultValue="false") boolean failGracefullySpecifies if a failed execution of the mojo will stop the build processIf
true
a failure during mojo execution will not stop the build process.- Seit:
- 0.6.0
-
gitDir
TheGIT_DIR
path of the Git repositoryWarning: Do not set this when you don't have a good reason to do so. The
GIT_DIR
can be found automatically if your project resides somewhere in a usual Git repository. -
head
The commit or ref to use as starting point for operations -
skip
@Parameter(property="mavanagaiata.skip", defaultValue="false") boolean skipSkip the plugin execution- Seit:
- 0.5.0
-
skipNoGit
@Parameter(property="mavanagaiata.skipNoGit", defaultValue="false") boolean skipNoGitSkip the plugin execution if not inside a Git repository- Seit:
- 0.5.0
-
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject projectThe Maven project -
propertyPrefixes
@Parameter(property="mavanagaiata.propertyPrefixes", defaultValue="mavanagaiata,mvngit") String[] propertyPrefixesThe prefixes to prepend to property keys
-
-
Konstruktordetails
-
AbstractGitMojo
AbstractGitMojo()
-
-
Methodendetails
-
execute
public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionGeneric execution sequence for a Mavanagaiata mojoWill initialize any needed resources, run the actual mojo code and cleanup afterwards.
- Löst aus:
org.apache.maven.plugin.MojoExecutionException
- if the mojo execution fails andfailGracefully
isfalse
org.apache.maven.plugin.MojoFailureException
- if the mojo execution fails andfailGracefully
istrue
- Siehe auch:
-
addProperty
Saves a property with the given name into the project's properties The value will be stored two times – with "mavanagaiata" and "mvngit" as a prefix.- Parameter:
name
- The property namevalue
- The value of the property
-
init
Generic initialization for all Mavanagaiata mojosThis will initialize the JGit repository instance for further usage by the mojo.
- Gibt zurück:
false
if the execution should be skipped- Löst aus:
MavanagaiataMojoException
- if the repository cannot be initialized
-
initRepository
Initializes a JGit Repository object for further reference- Gibt zurück:
- The repository instance
- Löst aus:
GitRepositoryException
- if retrieving information from the Git repository fails
-
prepareParameters
void prepareParameters()Prepares and validates user-supplied parameters -
run
The actual implementation of the mojo- Parameter:
repository
- The repository instance to use- Löst aus:
MavanagaiataMojoException
- if there is an error during execution
-