Mavanagaiata – [maˈvanaˈɡaːjaˈta] – is a Maven plugin providing information about the Git repository of your project.
- Maven 2.0+
- Apache Commons IO 2.4
- JGit 2.1.0
Mavanagaiata is available from the Central Repository and will be automatically installed by Maven once you add it as a plugin to your project. If you want to have the newest features available in the development code or you want to hack on the code you are free to clone the Git repository and install it manually. You can do so using the following commands:
$ git clone git://github.com/koraktor/mavanagaiata.git
$ cd mavanagaiata
$ mvn install
To use the Mavanagaiata plugin in your Maven project you will have to include the plugin in your POM and add the configuration suitable for your needs:
<project ...>
...
<build>
<plugins>
<plugin>
<groupId>com.github.koraktor</groupId>
<artifactId>mavanagaiata</artifactId>
<executions>
<execution>
<id>load-git-branch</id>
<goals>
<goal>branch</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
</project>
Mavanagaiata provides the following goals each reading specific information from the Git repository.
branch
: Information about the currently checked out branchchangelog
: Generates a changelog from Git commits and tagscommit
: Information about the current commitcontributors
: Generates a list of contributors from Git commitstag
: Information about the most recent tag
Each goal stores its information into the project's properties. The following
property keys will be prefixed with mavanagaiata.
and mvngit.
respectively.
You may override this with the configuration property propertyPrefixes
.
branch
branch
: The name of the currently checked out branch
commit
abbrev
: The abbreviated SHA ID of the current commitauthor.date
: The date the commit has been authoredauthor.name
: The name of the author of the current commitauthor.email
: The email address of the author of the current commitcommitter.date
: The date the commit has been committedcommitter.name
: The name of the committer of the current commitcommitter.email
: The email address of the committer of the current commitid
/sha
: The full SHA ID of the current commit
tag
name
: The name of the most recent tag (if any)describe
: A combination of the tag name and the current commit ID (same asgit describe
)
Mavanagaiata provides several configuration properties for its goals. The
following ones are global and can be used for any goal. They must be prefixed
with mavanagaiata.
:
dateFormat
: The date format to use for various dates (default:"MM/dd/yyyy hh:mm a Z"
)dirtyFlag
: The flag to append to various values if there are changes in the index or worktree (default:-dirty
)encoding
: The encoding to use for output files (default:"UTF-8"
)footer
: The footer to append to generated output (default:"\nGenerated by Mavanagaiata at %s"
). The%s
will be replaced by a formatted date.gitDir
: Specify the GIT_DIR to use (default:${basedir}
)head
: Specify the commit or ref used as a starting point (default:HEAD
)
Additionally, there are some properties specific to a goal:
changelog
(prefix:mavanagaiata.changelog.
):dateFormat
: The date format to use for tag output (default:${mavanagaiata.dateFormat}
)header
: The header to print above the changelog (default:"Changelog\n=========\n"
)commitPrefix
: The string to prepend to every commit message (default:" * "
)gitHubLinks
: Whether to generate links to GitHub's compare view (default:false
)gitHubProject
: The project name for GitHub links (default: not set)gitHubUser
: The project user for GitHub links (default: not set)outputFile
: If set, the changelog will not be printed toSystem.out
, but into the given file. (default: not set)skipTagged
: Whether to skip tagged commits' messages. This is useful when usually tagging commits like "Version bump to X.Y.Z" (default:false
)tagPrefix
: The string to prepend to the tag name (default:"\nVersion "
)
commit
(prefix:mavanagaiata.commit.
):dateFormat
: The date format to use for commit dates (default:${mavanagaiata.dateFormat}
)dirtyFlag
: The flag to append to the SHA ID if there are changes in the index or worktree (default:-dirty
)
contributors
(prefix:mavanagaiata.contributors.
):header
: The header to print above the contributor list (default:"Contributors\n============\n"
)outputFile
: If set, the list will not be printed toSystem.out
, but into the given file. (default: not set)showCounts
: Whether to show the number of contributions for each author (default:true
)showEmail
: Whether to show the email addresses of contributors (default:false
)sort
: The sorting applied to the list of contributors, may be one of "count", "date" and "name". (default:"count"
)
tag
(prefix:mavanagaiata.tag.
):dirtyFlag
: The flag to append to the tag name if there are changes in the index or worktree (default:-dirty
)
The name is a completely invented word hopefully sounding like a mighty god of an ancient, Southeast Asian primitive people or a similar mighty monster that same primitive people is afraid of.
Instead, it's just a combination of the command-line tools of Maven and Git:
mvn
and git
. Each character is suffixed with the character a
.
In Java code you would write this as:
("mvn" + "git").replaceAll("(.)", "$1a")
=> "mavanagaiata"
Mavanagaiata is an open-source project. Therefore you are free to help improving it. There are several ways of contributing to Mavanagaiata's development:
- Build projects using it and spread the word.
- Report problems and request features using the issue tracker.
- Write patches yourself to fix bugs and implement new functionality.
- Create a Mavanagaiata fork on GitHub and start hacking. Extra points for using GitHub's pull requests and feature branches.
This code is free software; you can redistribute it and/or modify it under the terms of the new BSD License. A copy of this license can be found in the included LICENSE file.
- Sebastian Staudt -- koraktor(at)gmail.com
- Pablo Graña -- pablo.grana(at)globant.com