Fork me on GitHub

mavanagaiata:info-class

Full name:

com.github.koraktor:mavanagaiata:1.0.1:info-class

Description:

This goal generates the source code for a Java class with Git information like commit ID and tag name.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 0.5.0.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
<baseDir> File - 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.


Default value is: ${project.basedir}.
User property is: mavanagaiata.baseDir.
<className> String - The name of the class to generate
Default value is: GitInfo.
User property is: mavanagaiata.info-class.className.
<dateFormat> String - The date format to use for various dates
Default value is: MM/dd/yyyy hh:mm a Z.
User property is: mavanagaiata.dateFormat.
<dirtyFlag> String 0.4.0 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.


Default value is: -dirty.
User property is: mavanagaiata.dirtyFlag.
<dirtyIgnoreUntracked> boolean 0.5.0 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.


Default value is: false.
User property is: mavanagaiata.dirtyIgnoreUntracked.
<encoding> String - The encoding of the generated source file
Default value is: ${project.build.sourceEncoding}.
User property is: mavanagaiata.info-class.encoding.
<failGracefully> boolean 0.6.0 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.


Default value is: false.
User property is: mavanagaiata.failGracefully.
<gitDir> File - 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.


User property is: mavanagaiata.gitDir.
<head> String - The commit or ref to use as starting point for operations
Default value is: HEAD.
User property is: mavanagaiata.head.
<outputDirectory> File - The directory to write the source code to

This directory is automatically added to the source roots used to compile the project.


Default value is: ${project.build.directory}/generated-sources/mavanagaiata.
User property is: mavanagaiata.info-class.outputDirectory.
<packageName> String - The name of the package in which the class will be generated
Default value is: ${project.groupId}.${project.artifactId}.
User property is: mavanagaiata.info-class.packageName.
<propertyPrefixes> String[] - The prefixes to prepend to property keys
Default value is: mavanagaiata,mvngit.
User property is: mavanagaiata.propertyPrefixes.
<skip> boolean 0.5.0 Skip the plugin execution
Default value is: false.
User property is: mavanagaiata.skip.
<skipNoGit> boolean 0.5.0 Skip the plugin execution if not inside a Git repository
Default value is: false.
User property is: mavanagaiata.skipNoGit.
<templateFile> File - The path to an alternative template for the info class
User property is: mavanagaiata.info-class.templatePath.

Parameter Details

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

  • Type: java.io.File
  • Required: No
  • User Property: mavanagaiata.baseDir
  • Default: ${project.basedir}

<className>

The name of the class to generate
  • Type: java.lang.String
  • Required: No
  • User Property: mavanagaiata.info-class.className
  • Default: GitInfo

<dateFormat>

The date format to use for various dates
  • Type: java.lang.String
  • Required: No
  • User Property: mavanagaiata.dateFormat
  • Default: MM/dd/yyyy hh:mm a Z

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

  • Type: java.lang.String
  • Since: 0.4.0
  • Required: No
  • User Property: mavanagaiata.dirtyFlag
  • Default: -dirty

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

  • Type: boolean
  • Since: 0.5.0
  • Required: No
  • User Property: mavanagaiata.dirtyIgnoreUntracked
  • Default: false

<encoding>

The encoding of the generated source file
  • Type: java.lang.String
  • Required: No
  • User Property: mavanagaiata.info-class.encoding
  • Default: ${project.build.sourceEncoding}

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

  • Type: boolean
  • Since: 0.6.0
  • Required: No
  • User Property: mavanagaiata.failGracefully
  • Default: false

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

  • Type: java.io.File
  • Required: No
  • User Property: mavanagaiata.gitDir

<head>

The commit or ref to use as starting point for operations
  • Type: java.lang.String
  • Required: No
  • User Property: mavanagaiata.head
  • Default: HEAD

<outputDirectory>

The directory to write the source code to

This directory is automatically added to the source roots used to compile the project.

  • Type: java.io.File
  • Required: No
  • User Property: mavanagaiata.info-class.outputDirectory
  • Default: ${project.build.directory}/generated-sources/mavanagaiata

<packageName>

The name of the package in which the class will be generated
  • Type: java.lang.String
  • Required: No
  • User Property: mavanagaiata.info-class.packageName
  • Default: ${project.groupId}.${project.artifactId}

<propertyPrefixes>

The prefixes to prepend to property keys
  • Type: java.lang.String[]
  • Required: No
  • User Property: mavanagaiata.propertyPrefixes
  • Default: mavanagaiata,mvngit

<skip>

Skip the plugin execution
  • Type: boolean
  • Since: 0.5.0
  • Required: No
  • User Property: mavanagaiata.skip
  • Default: false

<skipNoGit>

Skip the plugin execution if not inside a Git repository
  • Type: boolean
  • Since: 0.5.0
  • Required: No
  • User Property: mavanagaiata.skipNoGit
  • Default: false

<templateFile>

The path to an alternative template for the info class
  • Type: java.io.File
  • Required: No
  • User Property: mavanagaiata.info-class.templatePath