Klasse AbstractGitMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.github.koraktor.mavanagaiata.mojo.AbstractGitMojo
Alle implementierten Schnittstellen:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Bekannte direkte Unterklassen:
AbstractGitOutputMojo, BranchMojo, CheckMojo, CommitMojo, InfoClassMojo, TagMojo

abstract class AbstractGitMojo extends org.apache.maven.plugin.AbstractMojo
This abstract Mojo implements initializing a JGit Repository and provides this Repository instance to subclasses.
Seit:
0.1.0
Autor:
Sebastian Staudt
Siehe auch:
  • Feldübersicht

    Felder
    Modifizierer und Typ
    Feld
    Beschreibung
    (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
    The GIT_DIR path of the Git repository
    (Package privat) String
    The commit or ref to use as starting point for operations
    protected 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 repository

    Von Schnittstelle geerbte Felder org.apache.maven.plugin.Mojo

    ROLE
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    (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
    Generic execution sequence for a Mavanagaiata mojo
    protected GitRepository
    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 parameters
    protected abstract void
    run(GitRepository repository)
    The actual implementation of the mojo

    Von Klasse geerbte Methoden org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Felddetails

    • dateFormat

      @Parameter(property="mavanagaiata.dateFormat", defaultValue="MM/dd/yyyy hh:mm a Z") protected String dateFormat
      The date format to use for various dates
    • baseDir

      @Parameter(property="mavanagaiata.baseDir", defaultValue="${project.basedir}") File 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

      @Parameter(property="mavanagaiata.dirtyFlag", defaultValue="-dirty") String dirtyFlag
      The flag to append to refs if there are changes in the index or working tree

      Setting this to either "false" or "null" will disable flagging refs as dirty.

      Seit:
      0.4.0
    • dirtyIgnoreUntracked

      @Parameter(property="mavanagaiata.dirtyIgnoreUntracked", defaultValue="false") boolean dirtyIgnoreUntracked
      Specifies if the dirty flag should also be appended if there are untracked files

      If 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 failGracefully
      Specifies if a failed execution of the mojo will stop the build process

      If true a failure during mojo execution will not stop the build process.

      Seit:
      0.6.0
    • gitDir

      @Parameter(property="mavanagaiata.gitDir") File gitDir
      The GIT_DIR path of the Git repository

      Warning: 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.

    • skip

      @Parameter(property="mavanagaiata.skip", defaultValue="false") boolean skip
      Skip the plugin execution
      Seit:
      0.5.0
    • skipNoGit

      @Parameter(property="mavanagaiata.skipNoGit", defaultValue="false") boolean skipNoGit
      Skip 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 project
      The Maven project
    • propertyPrefixes

      @Parameter(property="mavanagaiata.propertyPrefixes", defaultValue="mavanagaiata,mvngit") String[] propertyPrefixes
      The 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.MojoFailureException
      Generic execution sequence for a Mavanagaiata mojo

      Will 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 and failGracefully is false
      org.apache.maven.plugin.MojoFailureException - if the mojo execution fails and failGracefully is true
      Siehe auch:
    • addProperty

      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.
      Parameter:
      name - The property name
      value - The value of the property
    • init

      protected GitRepository init() throws MavanagaiataMojoException
      Generic initialization for all Mavanagaiata mojos

      This 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

      GitRepository initRepository() throws GitRepositoryException
      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

      protected abstract void run(GitRepository repository) throws MavanagaiataMojoException
      The actual implementation of the mojo
      Parameter:
      repository - The repository instance to use
      Löst aus:
      MavanagaiataMojoException - if there is an error during execution